- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2023 10:56 PM
Hello, I'm trying to understand how business days work using the 8 - 5 weekdays excluding holidays schedule. I'm not getting the expected output from a simple test background script.
var startDate = new GlideDateTime('2023-07-03 20:00:00');
// 9 buiness hours
var days = 1;
days = days * 9;
var dur = new GlideDuration(60 * 60 * 1000 * days);
var schedule = new GlideSchedule('090eecae0a0a0b260077e1dfa71da828'); // 8-5 workdays excluding holidays
var dueDate = schedule.add(startDate, dur);
gs.print(dueDate.getDate());
gs.print(dueDate.getTime());
gs.print(dueDate.getDate().getDisplayValue());
gs.print(dueDate.getTime().getDisplayValue());
It does not skip over July 4th, which is an excluded holiday in that glide schedule. Is there a reason why?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2023 11:09 PM
Hi @Mark Cummins ,
I ran the same script and got correct result as below:
Can you please check the Holiday entry mentioned in schedule? is it repeated or not?
Regards, Shekhar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2023 11:09 PM
Hi @Mark Cummins ,
I ran the same script and got correct result as below:
Can you please check the Holiday entry mentioned in schedule? is it repeated or not?
Regards, Shekhar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 11:10 PM - edited 01-07-2025 11:11 PM
Hi @Shekhar Navhak1 ,
GlideSchedule is returning values which is considering 24 hrs as 1 day.
If i want result as per my schedule considering 9 hrs as 1 day how that can be achieve.
Below is my code,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2023 11:19 PM
Hi Shekhar, thank you for the help, the scheduled entry were not blank and only repeated until 2021. Now the output is correct.