Scoped GlideSchedule - isInSchedule(GlideDateTime time)

Determines if the given datetime is within the current schedule.

Table 1. Parameters
Name Type Description
time GlideDateTime The datetime value to check.
Table 2. Returns
Type Description
Boolean True if the specified datetime is within the schedule; otherwise, false.
var g = new GlideRecord('cmn_schedule');
g.addQuery('type', 'blackout');
g.query();
if (g.next()) {
   var sched = new GlideSchedule(g.sys_id);
   var d = new GlideDateTime();
   d.setDisplayValue("2007-09-18 12:00:00");
   if (sched.isInSchedule(d)) 
      gs.info("Is in the schedule");
   else
      gs.info("Is NOT in the schedule");
}

Output: