This server class provides methods for performing operations on SimpleSchedule objects, such as getting schedule name; determining if the current time value is working time or not or setting time zone for the schedule.
This method determines elapsed time in seconds in the schedule between two date-time values, using schedule time zone or, if not specified, the session time zone.
Parameter(s):
Name
Type
startDate
SimpleDateTime
endDate
SimpleDateTime
Return:
Type
Description
SimpleDuration
The difference between two time values (in seconds).
Example:
duration
let startDate = new SimpleDateTime('2019-10-25 08:00:00');
let endDate = new SimpleDateTime('2019-10-29 08:00:00');
let simple_schedule = new SimpleSchedule('1', 'Europe/Moscow');
let duration = simple_schedule.duration(startDate, endDate);
ss.info(duration.getValue());
This method determines the time after working seconds value specified in thefinalWorkingSecondsparameter passes.
Parameter(s):
Name
Type
startDate
SimpleDateTime
finalWorkingSeconds
Integer
Return:
Type
Description
String
The time value.
Example:
whenWillExpire
let startDate = new SimpleDateTime('2019-10-25 08:00:00');
let finalWorkingSeconds = 12345;
let simple_schedule = new SimpleSchedule('1', 'Europe/Moscow');
ss.info(simple_schedule.whenWillExpire(startDate, finalWorkingSeconds));
Determines how much time (in seconds) is left until next schedule item starts.
Parameter(s):
Name
Type
time
SimpleDateTime
timeZone
String
Return:
Type
Description
Integer
The number in milliseconds.
Example:
whenNext
let startDate = new SimpleDateTime('2019-10-25 08:00:00');
let simple_schedule = new SimpleSchedule('1', 'Europe/Moscow');
ss.info(simple_schedule.whenNext(startDate));