This addresses issue #117 (both the issue with get_updatedto_text() and with align_rebase_dates())
This PR enables these functions to handle dttm input by using an as.Date() step. This in turn reinstates the previously functional behaviour of lubridate::ceiling_date() (bump to start of next period) and the date-matching process in the rebase date function. These were not set up to handle dttms.
I have added some tests for get_updatedto_text() which document its expected behaviour, and have added in some assertion checks and slightly tidied up (perhaps) the case_when process. The use of "week.start = 1" (Monday) is made slightly more explicit using a withr::with_options() frame at the top of the case_when. (We don't have to do this - can be moved back to a line in case_when for agg == "week").
Tests for align_rebase_dates() have not yet been written.
Please confirm that you have:
[x] Run devtools::test() and fixed all failing tests and warnings.
[x] Added suppressMessages() to any test message which breaks the test progress UI.
@ThomUK please review this PR.
This addresses issue #117 (both the issue with
get_updatedto_text()
and withalign_rebase_dates()
)This PR enables these functions to handle dttm input by using an
as.Date()
step. This in turn reinstates the previously functional behaviour oflubridate::ceiling_date()
(bump to start of next period) and the date-matching process in the rebase date function. These were not set up to handle dttms.I have added some tests for
get_updatedto_text()
which document its expected behaviour, and have added in some assertion checks and slightly tidied up (perhaps) the case_when process. The use of "week.start = 1" (Monday) is made slightly more explicit using awithr::with_options()
frame at the top of the case_when. (We don't have to do this - can be moved back to a line in case_when foragg == "week"
).Tests for
align_rebase_dates()
have not yet been written.Please confirm that you have:
devtools::test()
and fixed all failing tests and warnings.suppressMessages()
to any test message which breaks the test progress UI.