How to identify the date is holiday or not from calendar

HexWIreless
Kilo Contributor

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

1 ACCEPTED SOLUTION

Mike Patel
Tera Sage

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");

}

View solution in original post

6 REPLIES 6

HexWIreless
Kilo Contributor

 

Thanks for your reply, It was really a very helpful to me.

udayrathore
Tera Contributor

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");

}