Skip to main content

system.kanoa.schedule.decodeScheduleBlock

Requires kanoaOPS license

Description

Decodes the passed-in event record using the rangeStart, rangeEnd and rruleStr from the scheduleBlock.

Syntax

decodeScheduleBlock(scheduleBlock, rangeStart, rangeEnd, tzOffsets)

Parameters:
  • scheduleBlock (dict): Dictionary representing the schedule block.
  • rangeStart (datetime): Start of the range to decode.
  • rangeEnd (datetime): End of the range to decode.
  • tzOffsets (dict): Timezone offset mappings.

  • Returns:
  • eventTimeList (list[datetime]): List of event datetimes.
  • Code Examples

    # Example Usage:
    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)