Skip to content

Commit 86112e5

Browse files
Update src/idatetime.c
Co-authored-by: Benjamin Schwendinger <[email protected]>
1 parent 7951e5a commit 86112e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/idatetime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ SEXP convertDate(SEXP x, SEXP type)
169169
int old_week = (yday / 7) + 1;
170170
ansp[i] = old_week;
171171
if (can_warn && new_week != old_week) {
172-
warning(_("The default behavior of data.table::week() is deprecated. It will be changed to 'sequential' in a future version. To opt-in to the new behavior now, run: options(datatable.week = 'sequential'). To suppress this warning and continue using the legacy behavior, run: options(datatable.week = 'legacy')."));
172+
warning(_("The default behavior of week() is changing. Previously ('legacy' mode), week numbers advanced every 7th day of the year. The new 'sequential' mode ensures the first week always has 7 days. For example, as.IDate('2023-01-07') returns week 2 in legacy mode but week 1 in sequential mode (week 2 starts on '2023-01-08'). To adopt the new behavior now, set options(datatable.week = 'sequential'). To keep the old results and silence this warning, set options(datatable.week = 'legacy'). See https://github.com/Rdatatable/data.table/issues/2611"));
173173
week_deprecation_warning_issued = 1;
174174
can_warn = false;
175175

0 commit comments

Comments
 (0)