Ceil milliseconds of datetime
Momentjs support only milliseconds so the datetime microseconds are trunked. The problem is that when such datetime is used for reading history records like in the account_invoice_history
module, the read value does not match the exact value because the clause <=
select the record before because of the trunking.
It will be better to ceil so the result will always be a datetime before the right value. This is important when the datetime is exactly the create datetime because then it raises an error as no record is found.
Another solution would be that Sao.DateTime
remember the exact millisecond to restitute it later but this will be hard to maintain with operations.