Skip to content

/ et al. drop class "hms" #119

@AshesITR

Description

@AshesITR

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions