- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2018 10:41 PM
Hi All,
I am new to service now and I need to identify the date I specify is holiday or not from the entry in Calendar, also need to know if its working day then what are the working hours for that day from Calendar.
I know these all things I can find from Calendar but I don't know how can I write script to access those details from Calendar.
Thank you
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2018 01:04 PM
Where exactly you want this info to be displayed?
you can do something like
var schedId = 'sys id of your schedule';
var sched = new GlideSchedule(schedId);
var d = new GlideDateTime();
if(sched.isInSchedule(d)){
gs.log("In schedule");
}else{
gs.log("Not in schedule");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2018 01:04 PM
Where exactly you want this info to be displayed?
you can do something like
var schedId = 'sys id of your schedule';
var sched = new GlideSchedule(schedId);
var d = new GlideDateTime();
if(sched.isInSchedule(d)){
gs.log("In schedule");
}else{
gs.log("Not in schedule");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2018 05:07 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2018 07:33 AM
Please mark answer correct so it gets removed from unanswered list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2019 12:26 AM
Hello,
Is it possible to get the name of the Entry that gives true/false for a specific time?
With regards
Anton
Thanks for your reply, It was really a very helpful to me.