Schema for Kronos Recurring Frequency

From RecurringFrequency.schema.yaml (kronos/RecurringFrequency.schema)

---
$id: https://skeleton.botmd.io/kronos/RecurringFrequency.schema
$schema: https://json-schema.org/draft-07/schema

title: Recurring Frequency
description: |-
  Recurring frequency objects describe complex recurring logic that are usually not supported by cron.
  This design is *probably* a super set of CRON.

type: object
additionalProperties: false
required: []

properties:
  every:
    title: Every
    description: Event recurs in multiples of `every` `unit`s. Defaults to 1.

    type: integer
    minimum: 1
  #end every

  unit:
    title: Unit
    description: The unit of measurement for `every`. Defaults to `day`.
    enum: [minute, hour, day, week, month, year]
  #end unit

  count:
    title: Count
    description: The number of times for this recurring frequency before it ends. Count is based on the `start_on`. Defaults to repeat infinitely.
    type: integer
    minimum: 1

  minute_of_hour:
    title: Minute of Hour
    description: For `unit = hour`, this is the `minute` of the hour for the event to recur. Required for `unit = hour`. Defaults to `0`.

    type: integer
    minimum: 0
    maximum: 59
  #end minute_of_hour

  time_of_day:
    title: Time of Day
    description: For `unit` is one of `{day, week, month, year}`, this is the `time` of the day for the event to recur. Required for `unit` in `{day, week, month, year}`. Defaults to `09:00`.

    type: string
    format: time
  #end time_of_day

  day_of_week:
    title: Day of Week
    description: For `unit = week`, this is the `day` of the week for the event to recur. Required for `unit = week`. Defaults to `mon`.

    enum: [mon, tue, wed, thu, fri, sat, sun]
  #end day_of_week

  day_of_month:
    title: Day of Month
    description: For `unit = month`, this is the `day` of the month for the event to recur. For certain days that do not occur every month (e.g., 31), it will fallback to the last day of the month (e.g., Feb 28). Required for `unit = month`. Defaults to `1`.

    type: integer
    minimum: 1
    maximum: 31
  #end day_of_month

  day_of_year:
    title: Day of Year
    description: For `unit = year`, this is the `day` of the year for the event to recur. For certain days that do not occur every month (e.g., 02/29), it will fallback to the closest equivalent (e.g., 02/28). Required for `unit = year`. Defaults to `1/1`.

    type: string
    pattern: '^(01|02|03|04|05|06|07|08|09|10|11|12)\/(01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$'
  #end day_of_year

  start_from_trigger:
    title: Start From Trigger
    description: |-
      If `true`, the event will start from the trigger time. If `false`, the event will start from the next recurring time. Defaults to `false`.

    type: boolean
#end properties

[Main Page] [Schema Documentation] [Examples]