cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
641
Views
1
Helpful
5
Replies

Scripting Tips

mightyking
Level 6
Level 6

Hello Experts,

Here's our opening hours:

Sunday to Thursday: 8am to 11pm

Friday and Saturday: 8am to 1:30am

Here's where I need your help:

When a public holiday falls on Monday (September 2, 2024, October 14, 2024, April 21, 2025, May 19, 2025, September 1, 2025, October 13, 2025), calls must be extended until 01:30 on Sundays.

Could you please share with me how you would do this?

Thanks,

MK

1 Accepted Solution

Accepted Solutions

I am a bit confused by your two posts as they seem to contradict each other, but what I understand from your post is this:

Regular schedule you close on Saturday at1:30 AM. If Monday is a holiday you close on Sunday at 1:30 AM. If so, don't worry about figuring out the specific day of the week. Put the special Saturdays and Sundays in an XML file and when they match extend the hours. If Saturday date you're open 24/7. If Sunday date you're open until 1:30 AM.

david

View solution in original post

5 Replies 5

I would setup a Monday_Holiday.xml file with the dates you want. Then check that XML file and branch out to a new spot where you can check the day of week. That would be the easiest method.

david

Thank you David,

I am able to get the day of the week by doing the following:

String[] weekday_names = new String[] {"", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
Date today = D[now]
String today_weekday_name = ""

Script Steps
Set today_weekday_name = weekday_names[today.dow]

I am looking for the day before the Monday (holiday). How can I code the day before in the script?

Thanks,

MK

I am a bit confused by your two posts as they seem to contradict each other, but what I understand from your post is this:

Regular schedule you close on Saturday at1:30 AM. If Monday is a holiday you close on Sunday at 1:30 AM. If so, don't worry about figuring out the specific day of the week. Put the special Saturdays and Sundays in an XML file and when they match extend the hours. If Saturday date you're open 24/7. If Sunday date you're open until 1:30 AM.

david

David,

It's not a special Sunday. We need to apply the solution to every Sunday that the day after is a Monday and it's a holiday for the years to come.

Thanks,

MK

It is a special Sunday, because you know what Sundays fall before a Monday holiday. My answer still applies regardless.

david