We have a call center that closes early on some holidays so I was in need of adding a time of day check to my holiday check, but I was struggling to find an answer on the internet. I started experimenting with a way to add the time of day check to the holiday check. I ended up working out a different way of doing a holiday check that does not use and XML document. To me the script seems much cleaner and I am able to add a time of day check to it. It is also clear in the script what days are holidays without having to reference a second document. I am not sure why more people do not use this method is there something I am missing. I have tested it and it works perfectly. Below is how I built the script. Now bear in mind this is a sub-script referenced by the actual call group script.
I started by creating two variables.
Date | string | “”
todayIsAHoliday | Boolean | false This matches the same variable from the parent script that will play the holiday message.
Then the first step in the script is a “set” step.
Set date = D[now] This is used to make sure the date shows in an easy to match format.
Next I use an “If” step where I list out the days that are holidays using (date == “11/26/15” || date == “1/1/16”)
If true I use the “Set” step to set todayisaholiday to true.
If false I go to another “If” step where I list out the days the call center closes early. If it is true the it goes to a time of day check for open hours do nothing and the rest set todayisaholiday to true.
False does nothing and then the script ends.
This logic is much shorter and simpler than reading an xml doc and then doing an increment loop to hit all the holiday entries.