tidyverse / hms

A simple class for storing time-of-day values
https://hms.tidyverse.org/
Other
138 stars 25 forks source link

Implicit coercion when operating with strings #38

Closed qgeissmann closed 5 years ago

qgeissmann commented 7 years ago

I personally find it quite useful to be able to implicitly coerce strings to time objects. I believe this is implemented in POSIXct. For instance: as.POSIXct("2016-01-01") == "2016-01-01" is TRUE. In hms, we could be writing x > "23:50:21.100" instead of x > hms(21.100, 50,23) (or explicitly using as.hms()). Now, we have:

> hms(1) > "00:00:02"
#> TRUE 

I am happy to implement this new feature if you want

krlmlr commented 7 years ago

I'd rather be explicit here, and not coerce implicitly.

krlmlr commented 6 years ago

Seems we can't define Ops.hms() without breaking things (#18). Would we need that to change the behavior of > ?

github-actions[bot] commented 3 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.