Changes in version 1.8.0.9000 Changes in version 1.8.0 (2026-03-25) - New function get_interval_duration() which returns the number of days covered by an element of a grates object, e.g. the following is TRUE identical( get_interval_duration(yearmonth(2020, 1:3)), c(31, 29, 31) ) breaking change - as.double() for objects now returns the same result (subject to type) as as.integer(). Both return the lower bound of related interval. Note that objects should still be treated as experimental for the time being. Changes in version 1.7.2 (2026-02-27) - Small updates to the vignette's css and js. Changes in version 1.7.1 (2025-12-19) - Patch release due to parallel test failure related to testthat. Changes in version 1.7.0 (2025-11-21) - For isoweek/epiweek/yearweek scales users can now use labels in the form "YYYY" (e.g. 2020) without them first being converted to the corresponding gregorian calendar representation. This can be achieved with the argument format = "year", i.e. `+ scale_x_grates_isoweek(format = "year")` Changes in version 1.6.0 (2025-08-26) breaking change - The default offset argument for the Date and POSIXt methods of the as_period() generic is now set as the minimum of the input argument. Motivated by discussion with @joshwlambert. - For as_period() methods, offset can now be passed as a character or factor value that is coercible to a Date. Again motivated by discussion with @joshwlambert. Changes in version 1.5.0 (2025-04-28) breaking change - is.numeric() now returns FALSE for all grates objects. This makes the underlying implementation more opaque to end users and feels more consistent with other behaviour (e.g. no/limited support for "Math" methods). Internal changes - We now use fastymd internally which can give a small performance improvement for larger workloads when working with yearweek and yearmonth objects. Changes in version 1.4.3 (2025-03-10) - Fixes vignette build. Changes in version 1.4.2 (2025-03-07) - Reworking of manual pages and vignette. - scale_x_grates_period() can now handle a date value for offset. Changes in version 1.4.1 (2025-02-05) - No longer downloads css/js when building vignette. Changes in version 1.4.0 (2025-01-17) - The format argument of the scale functions for , and can now be set to "week" to drop the year value from graph labels, i.e. plot + scale_x_grates_epiweek(format = "week") Changes in version 1.3.0 (2024-11-20) - (Re)introduction of the object and associated scale function. This functionality should be viewed as experimental for the time being and is marked as such in the documentation. Changes in version 1.2.2 (2024-08-29) - All images in the vignette now have alt text. - Minor documentation improvements. Changes in version 1.2.1 (2024-05-31) - Package now depends on R (>= 3.6.0). Changes in version 1.2.0 (2024-03-08) - New functions date_start() and date_end() for accessing the boundary elements of objects. - New function %during% for testing whether a scalar date is contained within the range (inclusive) of a object. Changes in version 1.1.1 (2024-02-28) - Users of the 3.5.0 release of ggplot2 will have noticed some additional "warnings" appearing within the plot. These have now been handled internally so please raise an issue if they reappear. - Minor internal and non-breaking changes motivated by lintr. Changes in version 1.1.0 (2023-06-08) - The scale functions (e.g. scale_x_grates_isoweek()) gain a breaks argument to allow exact specification of breaks. Changes in version 1.0.1 (2023-04-02) - Fix erroneous tests flagged by CRAN. - No user facing changes. Changes in version 1.0.0 (2023-03-17) For the first major release of grates a significant refactor has been undertaken that builds upon lessons learnt over the last two years. Whilst we have tried to limit breaking changes some functionality has been removed and some function parameters altered (see details below): breaking changes - objects are now always stored relative to the UNIX epoch. This is equivalent to setting origin = 0 in the previous release. Calling the function with an origin argument will now error. - Trying to create a object with n set to 1 will now error. Uses are encouraged to use for this case. - is now a defunct as it did not fit with the scope of the package (i.e grouped dates, not grouped integers). In particular the int_period(), as_int_period() and is_int_period() will now error on use. - The origin parameter from as been renamed to offset to better reflect its usage. Users will need to update uses of period(), as_period() and scale_x_grates_period() to reflect this. - as_yearweek() no longer parsers character strings of the form "YYYY-Www" (e.g. "2020-W01"). - Constructors yearweek() and isoweek() and epiweek() now allow construction of grates objects directly from year and week integer vectors. yearmonth() and yearquarter() constructors have been similarly changed to allow construction from year and month/quarter integer vectors. - The old incarnation of direct constructors now begin with a new_ prefix (e.g. new_month(), new_yearweek(), new_epiweek(), ...). This is to distinguish them from more user friendly constructors that we have introduced (see above). new functions and classes - A new yearmonth class () and associated functions have been introduced. This object is similar to what was previously obtained via a call of month(x, n = 1L, origin = 0L) (now defunct - see above). - New isoweek and epiweek classes ( and respectively) and associated functions. Internally these are similar to the corresponding objects but with a marginally more efficient implementation. bug fixes - is.numeric() methods for grates objects previously returned FALSE. Calls to these methods now dispatch to the default implementation based on the underlying type and should now return TRUE. miscellaneous - Hard dependencies on clock and vctrs have now been removed. Changes in version 0.3.1 (2022-11-10) - Fix for changes made to POSIXlt objects in R-devel. Changes in version 0.3.0 (2021-10-21) New functions - seq() methods now implemented for all grates objects. bug fixes - Conversion functions now preserve names. - Bug fixes for cast functions operating on objects of the same class but with different attributes. Changes in version 0.2.0 (2021-05-28) - This is a breaking release that changes the underlying implementations of the different grate constructors and associated scales for ggplot2. There has also been some renaming of function arguments to bring greater consistency across packages. - We now make more use of the high level API introduced by the clock package for working with R's date and date-time types. Changes in version 0.1.2 (2021-03-28) bug fixes - Fixed bug affecting scale_x_period() Changes in version 0.1.1 (2021-03-19) - Initial release