wilsonfreitas / R-bizdays

Business Days Calculations and Utilities
http://wilsonfreitas.github.io/R-bizdays/
Other
52 stars 20 forks source link

Previous business day not working #89

Closed tbrown122387 closed 3 years ago

tbrown122387 commented 3 years ago

I can't get the previous business day. Isn't this supposed to return yesterday?

library(bizdays) 
modified.preceding(Sys.Date()) # this is today
modified.preceding(as.Date("2021-05-31")-1) # this is a sunday 

From the documentation: "modified.following rolls the given date to the next business day, unless it happens in the next month, in this case it re-turns the previous business day. modified.preceding is similar to modified.following, but rolls the given date to the previous business day.

wilsonfreitas commented 3 years ago

Which calendar are you using?

Try weekends calendar.

tbrown122387 commented 3 years ago

I think there are just a lot of words that don't mean what I think they mean. (e.g. previous, weekdays != weekends, etc.) I think I'm looking for something different so I'll roll my own. Thanks anyway.