schedule returning isValid() = true but next(10) returns an array of undefineds
var s2 = {
"schedules": [{"m":[0,15,30,45],s:0}],
"exceptions":[]
};
var n1 = later.schedule(s2).isValid();
var n2 = later.schedule(s2).next(10);
console.log(n1);
console.log(n2);
outputs :
true
[ undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined ]
I now know that the s key needs to be an array : [0] instead of 0.
Still, I think it is a bug that the isValid() returns true, isn't it ?
isValid(date) is used to determine if a particular date is valid based on the schedule, not if the schedule itself is valid. It unfortunately returns true for invalid schedules as a side affect of assuming that the schedule is properly formed. Is might be interesting to add a isScheduleValid() function but that doesn't currently exist.
Ok, I get that, isScheduleValid would indeed be helpful
So how to validate if the current date is valid to a schedule?
Is there a way to validate a cron expression in this library ?