tidyverse / hms

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

Parse without seconds #111

Open gregorp opened 2 years ago

gregorp commented 2 years ago

Not sure if this is a dupe of #30, but I'd expect as_hms to work without seconds, or at least give an intelligible warning or error.

hms::as_hms("08:00")
Error in `abort_lossy_cast()`:
! Lossy cast from <character> to <hms> at position(s) 1
Run `rlang::last_error()` to see where the error occurred.

Inspired by this Stack Overflow question where a user without seconds couldn't figure out what was going wrong.