-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Most computations with hms
drop the class to difftime
causing worse UX.
hms::hms(10.5) / 2.0
#> Time difference of 5.25 secs
`/.hms` <- function(a, b) {
res <- as.difftime(unclass(a), units = attr(a, "units")) / b
hms::as_hms(res)
}
hms::hms(10.5) / 2.0
#> 00:00:05.25
sum(hms::hms(c(10L, 10L)))
#> Time difference of 20 secs
Created on 2023-08-18 with reprex v2.0.2
Metadata
Metadata
Assignees
Labels
No labels