Scoped GlideSchedule - isValid()

Determines if the current schedule is valid. A schedule is valid if it has at least one schedule span.

Table 1. Returns
Type Description
Boolean True if the schedule is valid.
var g = new GlideRecord('cmn_schedule');
g.addQuery('type', 'blackout');
if ( {
   var sched = new GlideSchedule(g.sys_id);
   var d = new GlideDateTime();
   d.setDisplayValue("2007-09-18 12:00:00");
   if (sched.isValid())"Is valid");
   else"Is not valid");