system.kanoa.schedule.decodeScheduleBlock(scheduleBlock, rangeStart, rangeEnd, tzOffsets)
Decodes the rruleStr passed in the scheduleBlock and returns a list of start and end times. Note this function can only be run in gateway scope.
Parameters
scheduleBlock Dictionary
rangeStart DateTime
rangeEnd DateTime
tzOffsets Dictionary: {'Pacific Standard Time': {startOffsetMins': -480, 'endOffSetMins': -480}}
Returns
eventTimeList list[datetimes]
Example
scheduleBlock = system.kanoa.utilities.convertDatasetRowToJSON(system.kanoa.schedule.getScheduleBlocks({'scheduleBlockId': 938}),0)
startDate = system.date.parse("2025-01-01 00:00:00")
endDate = system.date.parse("2025-01-07 00:00:00")
tzOffsets = {'Pacific Standard Time': {'startOffsetMins': -480, 'endOffSetMins': -480}}
eventTimes = system.kanoa.schedule.decodeScheduleBlock(scheduleBlock, startDate, endDate, tzOffsets)