Closed vspinu closed 1 year ago
There is no simple and consistent way to implement this. The moment one opens a box of rounding across units a question arises why not to round across parent of the parent. For example if if .6H rounds with respect to the day origin then we would need to round both hours and minutes, and potentially seconds of the original date time.
The current implementation allows for integer multi-units and fractional sub-units map to the child unit (e.g. .6h = 40min).
I have just implemented a new argument origin
which can be used with absolute
units (aka durations) only. It is vectorised across the input date-time
vector, thus should cover most of the use-cases.
https://github.com/tidyverse/lubridate/issues/925