Period

PartDraftv1.0.0-rc.2

A recurring window in local time that a rule judges by, such as night-time from 22:00 to 07:00. A window whose end is not after its start runs past midnight.

https://opendevelopmentstandards.org/schema/1.0.0-rc.2/core/Period.json

Fields

  • id
    textnot empty

    The record's id: unique within the document.

  • nameRequired
    text

    The name the regulation uses, for example Nighttime.

  • description
    text

    What the period covers, in words.

  • citation

    The part of the published framework that defines the period.

  • timeZone
    text

    The IANA time zone the times are in, for example America/Edmonton. Leave it out to use the zone of the place being judged.

  • windowsRequired
    List ofWindow1 or more items

    The windows that make up the period. A time falls in the period when it falls in any window.

Window

One daily window of a period.

  • days
    List ofOne ofmontuewedthufrisatsun1 or more items

    The days the window applies on. Leave it out for every day.

  • publicHolidays
    One ofthe codes below

    How the window treats public holidays. Leave it out to ignore them.

    include
    The window also applies on public holidays.
    exclude
    The window does not apply on public holidays.
    only
    The window applies on public holidays only.
  • startRequired
    textmatches ^([01][0-9]|2[0-3]):[0-5][0-9]$

    When the window starts each day, in local time (HH:MM).

  • endRequired
    textmatches ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$

    When the window ends each day, in local time (HH:MM, or 24:00 for midnight at the end of the day).

Links

Examples

An id that another example defines opens that record.

Example 2

{
  "id": "nsw-day",
  "name": "Day",
  "timeZone": "Australia/Sydney",
  "windows": [
    {
      "days": [
        "mon",
        "tue",
        "wed",
        "thu",
        "fri",
        "sat"
      ],
      "publicHolidays": "exclude",
      "start": "07:00",
      "end": "18:00"
    },
    {
      "days": [
        "sun"
      ],
      "start": "08:00",
      "end": "18:00"
    },
    {
      "publicHolidays": "only",
      "start": "08:00",
      "end": "18:00"
    }
  ]
}
Show 1 more example

Example 1

{
  "id": "night",
  "name": "Nighttime",
  "windows": [
    {
      "start": "22:00",
      "end": "07:00"
    }
  ]
}

Changes and file

Changes

  1. 0.1.0 First version.

Schema file

Show the JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opendevelopmentstandards.org/schema/1.0.0-rc.2/core/Period.json",
  "title": "Period",
  "description": "A recurring window in local time that a rule judges by, such as night-time from 22:00 to 07:00. A window whose end is not after its start runs past midnight.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "description": "The record's id: unique within the document."
    },
    "name": {
      "type": "string",
      "description": "The name the regulation uses, for example Nighttime."
    },
    "description": {
      "type": "string",
      "description": "What the period covers, in words."
    },
    "citation": {
      "$ref": "Citation.json",
      "description": "The part of the published framework that defines the period."
    },
    "timeZone": {
      "type": "string",
      "description": "The IANA time zone the times are in, for example America/Edmonton. Leave it out to use the zone of the place being judged."
    },
    "windows": {
      "type": "array",
      "minItems": 1,
      "description": "The windows that make up the period. A time falls in the period when it falls in any window.",
      "items": {
        "$ref": "#/$defs/Window"
      }
    }
  },
  "required": [
    "name",
    "windows"
  ],
  "patternProperties": {
    "^x-": {}
  },
  "unevaluatedProperties": false,
  "$defs": {
    "Window": {
      "type": "object",
      "properties": {
        "days": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "enum": [
              "mon",
              "tue",
              "wed",
              "thu",
              "fri",
              "sat",
              "sun"
            ]
          },
          "description": "The days the window applies on. Leave it out for every day."
        },
        "publicHolidays": {
          "type": "string",
          "enum": [
            "include",
            "exclude",
            "only"
          ],
          "description": "How the window treats public holidays. Leave it out to ignore them.",
          "x-ods-options": [
            {
              "value": "include",
              "title": "Include",
              "description": "The window also applies on public holidays."
            },
            {
              "value": "exclude",
              "title": "Exclude",
              "description": "The window does not apply on public holidays."
            },
            {
              "value": "only",
              "title": "Only",
              "description": "The window applies on public holidays only."
            }
          ]
        },
        "start": {
          "type": "string",
          "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
          "description": "When the window starts each day, in local time (HH:MM)."
        },
        "end": {
          "type": "string",
          "pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$",
          "description": "When the window ends each day, in local time (HH:MM, or 24:00 for midnight at the end of the day)."
        }
      },
      "required": [
        "start",
        "end"
      ],
      "description": "One daily window of a period.",
      "patternProperties": {
        "^x-": {}
      },
      "unevaluatedProperties": false
    }
  },
  "examples": [
    {
      "id": "night",
      "name": "Nighttime",
      "windows": [
        {
          "start": "22:00",
          "end": "07:00"
        }
      ]
    },
    {
      "id": "nsw-day",
      "name": "Day",
      "timeZone": "Australia/Sydney",
      "windows": [
        {
          "days": [
            "mon",
            "tue",
            "wed",
            "thu",
            "fri",
            "sat"
          ],
          "publicHolidays": "exclude",
          "start": "07:00",
          "end": "18:00"
        },
        {
          "days": [
            "sun"
          ],
          "start": "08:00",
          "end": "18:00"
        },
        {
          "publicHolidays": "only",
          "start": "08:00",
          "end": "18:00"
        }
      ]
    }
  ],
  "x-ods-status": "draft",
  "x-ods-kind": "part",
  "x-ods-module": "core",
  "x-ods-changes": {
    "0.1.0": "First version."
  }
}