datey 0.1.3
- Added anniversary days for circumstances where anniversaries are the main focus, such as defining datasets by policy anniversary. Under this interpretation, all years have 366 days but 29 February is treated as always being just under a quarter of the length of other days. This means that adding whole years always lands on the same calendar date, regardless of whether it is in a leap year or not. Use
start_anniversary_day()to create them,is_start_anniversary_day()to test for them andstart_anniversary_day_to_ymd()to recover year, month and day using the same interpretation.
datey 0.1.2
CRAN release: 2026-09-16
- Added
rep()methods fordatey,durationyanddatey_interval. Previouslyrep()dropped the class and returned bare integer or double values. Asrep_len()andrep.int()fall back torep()dispatch, they are fixed too. This also fixespmax()andpmin(), which previously returned the wrong values fordateyanddurationywhen arguments of different lengths were recycled.
datey 0.1.1
CRAN release: 2026-07-14
- Fixed undefined behaviour (negation of
NA_INTEGER) when parsingdurationyfrom text in C++. Results are unaffected on conforming hardware.
datey 0.1.0
CRAN release: 2026-07-07
Initial CRAN release.
-
dateyanddurationyrepresent dates and durations on a discrete annual grid, with exact, associative arithmetic (+,-, comparisons,mean(),range(), etc.). -
start_day(),mid_day(),end_day()anddatey()map calendar year/month/day (and day-fraction), fractional years andDate,POSIXct,POSIXlttodatey. -
to_ymdf()and$year,$month,$dayand$day_fractionprovide the breakdown of adateyinto year, month, day and day fraction components. -
is_start_day()andis_mid_day()provides checking ofdateyalignment. -
as.double()andas.integer()provide convenient conversion to numeric types as years, with mixed number anddatey/durationyarithmetic adhering to the same convention using implicit conversion. -
NA_datey_,NA_durationy_andNA_datey_interval_provide type-correctNAs, with fullis.na()/anyNA()support. - Text parsing and formatting for
datey,durationyanddatey_interval. -
pillar_shaft()methods for readable printing ofdatey/durationy/datey_intervalcolumns in tibbles. -
is_leap_year()for integer years anddateys. -
datey_interval(constructed withdatey_interval()or%to%) represents a half-open[start, end)date interval. Operations include:-
==and!=for equality comparison. -
%includes%(orinterval_includes()) to test whether an interval contains adateyor numeric value. -
&for intersection: returns an empty collapsed interval for adjacent intervals,NA_datey_interval_for non-intersecting non-adjacent intervals. -
is_collapsed(),is_proper()and related predicates. - Constants
all_of_timeandNA_datey_interval_.
-
-
seq()is supported fordateyanddurationyvia abyargument (note:length.outis not supported).