|  Developer

isDateRange

  • The date range condition becomes TRUE when current date is in between start date and end date if start date is greater than end date. If start date is less than end date condition becomes TRUE when current date is less than start date or is greater than and end ( inverted range ). All arguments is optional but at least one of parameter should set.
  • This feature is available since version.
Edit
Schedule type Description
Daily Only the start time or the end date or both are set. If time is not set than default value is used. Example: 10:20 is the start time and the end time is not set then range starts from 10:20 till 23:59 every day. If 17:30 is start and 12:30 is end then it is inverted range starts from 17:30 till next day in 12:30 every day.
Monthly The start day or the end day or both are set. If 31th day is set and month has only 30th day than 30th day is used. The start and the end time could be also set. Example: 5th day and 10:20 time is start and 10th day and 14:30 time is end then range starts from 5th day in 10:20 till 10th day in 14:30 every month. If time is not set then range starts from 5th day in 00:00 till 10th day in 23:59 every month.
Yearly The start month or the end month or both are set. The day and time could be also set. Example: 4th month, 5th day and 10:20 time is start and 9th month, 10th day and 14:30 time is end then range starts from 04-04T10:20 till 09-10T14:30 every year. If day and time is not set then range starts from 04-01T00:00 till 09-30T23:59 every year.
Years The start year or the end year or both are set. The month, day and time could be also set. Example: 2021 year, 4th month, 5th day and 10:20 time is start and 2023 year, 9th month, 10th day and 14:30 time is end then range starts from 2021-04-04T10:20 till 2023-09-10T14:30 every year. If only years are set then another parameter has default values. For example: 2021 year is start and 2023 year is end then range starts from 2021-01-01T00:00 till 2023-12-31T23:59.
Edit
Field Type Required Description
blockOptions.method.args.startTime 24_hours_time Time when condition become TRUE. Default value: 00:00.
blockOptions.method.args.startDay int Day when condition become TRUE. Default value: 1.
blockOptions.method.args.startMonth int Month when condition become TRUE. Default value: 1.
blockOptions.method.args.startYear int Year when condition become TRUE. Default value: 1.
blockOptions.method.args.endTime 24_hours_time Time when condition become FALSE. Default value: 23:59.
blockOptions.method.args.endDay int Day when condition become FALSE. Default value: last day of endMonth.
blockOptions.method.args.endMonth int Month when condition become FALSE. Default value: 12.
blockOptions.method.args.endYear int Year when condition become FALSE. Default value: 9223372036854775807.
Edit
Internal error code Message Data
SCENE_DATE_RANGE_NOT_DEFINED Start or End of date range should be defined ezlo.scenes.block.when.date.range.not.defined
SCENE_WRONG_DATE Wrong date ezlo.scenes.block.when.date
SCENE_WRONG_TIME Wrong time ezlo.scenes.block.when.time
SCENE_WRONG_TIME_FORMAT Wrong time format ezlo.scenes.block.when.time.format
WRONG_FIELD Wrong field of object rpc.params.wrong_field
Edit
"when" : [{ "blockOptions":{ "method":{ "name":"isDateRange", "args":{ "startTime":"startTime", "startDay":"startDay", "startMonth":"startMonth", "startYear":"startYear", "endTime":"endTime", "endDay":"endDay", "endMonth":"endMonth", "endYear":"endYear", } } }, "blockType":"when", "fields":[ { "name": "startTime", "type": "24_hours_time", "value": "10:20" }, { "name": "startDay", "type": "int", "value": 5 }, { "name": "startMonth", "type": "int", "value": 12 }, { "name": "startYear", "type": "int", "value": 2019 }, { "name": "endTime", "type": "24_hours_time", "value": "10:20" }, { "name": "endDay", "type": "int", "value": 5 }, { "name": "endMonth", "type": "int", "value": 12 }, { "name": "endYear", "type": "int", "value": 2021 }, ] }]