You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my setup, weekdays(Sys.Date() + 0:6) returns c("Freitag", "Samstag", "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag"), meaning weekday names are in my system's locale (German).
As a result, the filtering condition:
does not work because "Saturday" and "Sunday" do not match "Samstag" and "Sonntag".
Issue in R/generate_output_dates.R
else if(freq %in% c("B")){
dt <- seq(from = start_date, by = "day", length.out = h+1+ceiling(h/5)*2+2) # ceiling(h/5)*2+2 ~ number of weeks*2 days (Saturday and Sunday) plus an extra weekend to be on the safe side
dt <- dt[!weekdays(dt) %in% c("Saturday", "Sunday")]
dt <- format(dt, "%Y-%m-%d")
}
Possible Fix:
Using lubridate::wday(dt) could possibly resolve this issue:
dt <- dt[lubridate::wday(dt) %in% 2:6]
The text was updated successfully, but these errors were encountered:
In my setup, weekdays(Sys.Date() + 0:6) returns c("Freitag", "Samstag", "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag"), meaning weekday names are in my system's locale (German).
As a result, the filtering condition:
does not work because "Saturday" and "Sunday" do not match "Samstag" and "Sonntag".
Issue in R/generate_output_dates.R
Possible Fix:
Using lubridate::wday(dt) could possibly resolve this issue:
The text was updated successfully, but these errors were encountered: