Add function to get the number of operating days in the month.
[R/operatingdays.git] / R / getRemainingOpDays.R
index eae5c8716b096264ac45856198364c929d2d6136..a201071c26a182e6fb192e2f2f791fe67db0cd55 100644 (file)
@@ -21,6 +21,7 @@ getRemainingOpDays <- function(country,state,date) {
   state.public.holidays <- public.holidays[public.holidays$Applicable.To %in% c(state,"NAT"),]
   state.public.holidays$Date<-as.Date(state.public.holidays$Date,"%Y%m%d")
 
+  date <- as.Date(date)
   today <- Sys.Date()
   startdate <- as.Date(cut(date, "month"))
   enddate <- seq(startdate, by = "1 months", length.out = 2)[2]