- hms is now marked as “stable”.
"hms" objects no longer have a common type with
numeric. Combining such values previously threw a warning, now throws an error (#94).
as_hms() now throw error instead of a warning if input can’t be parsed (#68).
vec_cast() now correctly treat objects of class
integer mode (#84).
- Using lifecycle package (#94).
- hms has been re-licensed as MIT (#86).
vec_ptype2.hms.unspecified() (#80, @romainfrancois).
vec_ptype2.hms.default() forwards to
vec_default_ptype2() for compatibility with vctrs 0.2.1.
as.data.frame.hms(), handeld by vctrs.
- Lossy casts from
character vectors to
hms now also trigger a warning if the cast succeeds in the first element of the vector but fails for other elements.
Now based on vctrs >= 0.2.0 (#61). This adds support for
vec_ptype2(). Some operations (such as subset assignment) are now stricter. The
new_hms() constructor permits safe construction of
hms objects from a numeric vector.
is_hms() deprecates the existing
as.hms() is deprecated in favor of
vec_cast() or the new
as_hms() (which is just a thin wrapper around
Always show seconds in a pillar if they are different from zero (#54).
Values with nonzero hours, seconds and split-seconds are now displayed correctly in tibbles (#56), even with a very small distance to the full second (#64).
- Don’t test colored output on CRAN.
- Correct reference link on r4ds (#58, @evanhaldane).
- Adapted tests to pillar 1.2.1.
NA when converting to
character (#51, @jeroen).
- Adapted tests to pillar 1.1.0.
hms() now works correctly if all four components (days, hours, minutes, seconds) are passed (#49).
hms() creates a zero-length object of class
hms that prints as
as.hms(integer()) both work and are identical to
- Values with durations of over 10000 hours are now printed correctly (#48).
c() now returns a hms (#41, @qgeissmann).
Documentation and error messages
- Fix and enhance examples in
- Documentation is in Markdown format now.
- Improved error message if calling
hms() with a character argument (#29).
lubridate test for compatibility with 1.6.0 (#23, @vspinu).
- NA values are formatted as
Minor fixes and improvements.
- Subsetting keeps
hms class (#16).
format.hms() right-justifies the output by padding with spaces from the left,
as.character.hms() remains unchanged.
- Times larger than 24 hours or with split seconds are now formatted correctly (#12, #13).
- Sub-second part is printed with up to six digits, for even smaller values trailing zeros are shown (#17).
First CRAN release.
- Values are stored as a numeric vector that contains the number of seconds since midnight.
- Inherits from
- Updating units is a no-op, anything different from
"secs" issues a warning.
- Supports construction from time values, coercion to and from various data types, and formatting.
- Conversion from numeric treats input as seconds.
- Negative times are formatted with a leading
- Can be used as a regular column in a data frame.
- Full test coverage.
- Test for arithmetic with
- Test basic compatibility with
lubridate package (#5).