This class implements the BPS schedule object. More...
Public Member Functions | |
| Boolean | dayOfMonth (Number aDayOfMonth) const |
| Date | firstDateTime (Date aDate) const |
| Find the first date/time for a given date. | |
| Boolean | hour (Number aHour) const |
| Boolean | isDateIncluded (Date aDate) const |
| Check if a date is included in the schedule. | |
| Boolean | isDateTimeIncluded (Date aDateTime) const |
| Check if a date/time is included in the schedule. | |
| Date | lastDateTime (Date aDate) const |
| Find the last date/time for a given date. | |
| Boolean | minute (Number aMinute) const |
| Boolean | month (Mixed aMonth) const |
| Date | nextDate (Date aStart) const |
| Find the next schedule date after the given start date. | |
| Date | nextDateTime (Date aStart) const |
| Find the next schedule date/time after the given start date/time. | |
| Date | previousDate (Date aStart) const |
| Find the previous schedule date before the given start date. | |
| Date | previousDateTime (Date aStart) const |
| Find the previous schedule date/time before the given start date/time. | |
| Schedule (String aCronText) | |
| void | setDayOfMonth (Number aDayOfMonth, Boolean aEnable) |
| Change the enable state of a day of month. | |
| void | setHour (Number aHour, Boolean aEnable) |
| Change the enable state of a hour. | |
| void | setMinute (Number aMinute, Boolean aEnable) |
| Change the enable state of a minute. | |
| void | setMonth (Mixed aMonth, Boolean aEnable) |
| Change the enable state of a month. | |
| void | setWeekday (Mixed aWeekday, Boolean aEnable) |
| Change the enable state of a weekday. | |
| String | toString () const |
| Boolean | weekday (Mixed aWeekday) const |
Properties | |
| String | cronText |
| The schedule string. | |
This class implements the BPS schedule object.
Example usage:
importExtension('bps'); var sched = new bps.Schedule('0 8,12 * mon,wed,fri *'); var d = new Date; print('Next 10 dates for schedule '+sched.cronText+' after '+d+':'); for (var i = 0; i < 10; ++i) { print(d); d = sched.nextDateTime(d); } // for
| bps::Schedule::Schedule | ( | String | aCronText | ) |
| aCronText | The CRON text representation. |
| Boolean bps::Schedule::dayOfMonth | ( | Number | aDayOfMonth | ) | const |
| [in] | aDayOfMonth | Must be in the range 1 ... 31 |
| Date bps::Schedule::firstDateTime | ( | Date | aDate | ) | const |
Find the first date/time for a given date.
| [in] | aDate | The date. |
| Boolean bps::Schedule::hour | ( | Number | aHour | ) | const |
| [in] | aHour | Must be in the range 0 ... 23 |
| Boolean bps::Schedule::isDateIncluded | ( | Date | aDate | ) | const |
Check if a date is included in the schedule.
| [in] | aDate | The date to check. |
| Boolean bps::Schedule::isDateTimeIncluded | ( | Date | aDateTime | ) | const |
Check if a date/time is included in the schedule.
| [in] | aDateTime | The date/time to check. |
| Date bps::Schedule::lastDateTime | ( | Date | aDate | ) | const |
Find the last date/time for a given date.
| [in] | aDate | The date. |
| Boolean bps::Schedule::minute | ( | Number | aMinute | ) | const |
| [in] | aMinute | Must be in the range 0 ... 59 |
| Boolean bps::Schedule::month | ( | Mixed | aMonth | ) | const |
| [in] | aMonth | Must either be a string of: jan feb mar apr may jun jul aug sep oct nov dec, or a number in the range 1 ... 12 |
| Date bps::Schedule::nextDate | ( | Date | aStart | ) | const |
Find the next schedule date after the given start date.
| [in] | aStart | The date to start searching from. |
| Date bps::Schedule::nextDateTime | ( | Date | aStart | ) | const |
Find the next schedule date/time after the given start date/time.
| [in] | aStart | The date/time to start searching from. |
| Date bps::Schedule::previousDate | ( | Date | aStart | ) | const |
Find the previous schedule date before the given start date.
| [in] | aStart | The date to start searching from. |
| Date bps::Schedule::previousDateTime | ( | Date | aStart | ) | const |
Find the previous schedule date/time before the given start date/time.
| [in] | aStart | The date/time to start searching from. |
| void bps::Schedule::setDayOfMonth | ( | Number | aDayOfMonth, |
| Boolean | aEnable | ||
| ) |
Change the enable state of a day of month.
| [in] | aDayOfMonth | Must be in the range 1 ... 31 |
| [in] | aEnable | The new enable state to set. |
| void bps::Schedule::setHour | ( | Number | aHour, |
| Boolean | aEnable | ||
| ) |
Change the enable state of a hour.
| [in] | aHour | Must be in the range 0 ... 23 |
| [in] | aEnable | The new enable state to set. |
| void bps::Schedule::setMinute | ( | Number | aMinute, |
| Boolean | aEnable | ||
| ) |
Change the enable state of a minute.
| [in] | aMinute | Must be in the range 0 ... 59 |
| [in] | aEnable | The new enable state to set. |
| void bps::Schedule::setMonth | ( | Mixed | aMonth, |
| Boolean | aEnable | ||
| ) |
Change the enable state of a month.
| [in] | aMonth | Must either be a string of: jan feb mar apr may jun jul aug sep oct nov dec, or a number in the range 1 ... 12 |
| [in] | aEnable | The new enable state to set. |
| void bps::Schedule::setWeekday | ( | Mixed | aWeekday, |
| Boolean | aEnable | ||
| ) |
Change the enable state of a weekday.
| [in] | aWeekday | Must either me a string of: sun mon tue wed thu fri sat, or a number in the range 0 ... 7, where 0/7 = sun, 1 = mon, 2 = tue, etc. |
| [in] | aEnable | The new enable state to set. |
| String bps::Schedule::toString | ( | ) | const |
| Boolean bps::Schedule::weekday | ( | Mixed | aWeekday | ) | const |
| [in] | aWeekday | Must either me a string of: sun mon tue wed thu fri sat, or a number in the range 0 ... 7, where 0/7 = sun, 1 = mon, 2 = tue, etc. |
String bps::Schedule::cronText [read, write] |
The schedule string.