XUND API Documentation

DetailedOpeningHours

DetailedOpeningHours extends OpeningHours

DetailedOpeningHours adds a user friendly detailedData property to the OpeningHours model.

The basic structure is the same as in the base class:

Note: 0 means Monday and 6 means Sunday

TypeScript
{
    0: Array<{ start: string, finish: string }>
    1: Array<{ start: string, finish: string }>
    2: Array<{ start: string, finish: string }>
    3: Array<{ start: string, finish: string }>
    4: Array<{ start: string, finish: string }>
    5: Array<{ start: string, finish: string }>
    6: Array<{ start: string, finish: string }>
}

The added detailedData property’s definition:

Property name

Property type

Property description

type

OPENS_SOON | CLOSES_SOON | OPEN | CLOSED | CLOSED_TODAY | ALREADY_CLOSED | NO_DATA

Marks the type of the detailed data.

  • OPENS_SOON and CLOSES_SOON means the marked event will happen within two hours. timeData parameter in UTC timezone is provided for exact time.

  • OPEN and CLOSED means current status

  • CLOSED_TODAY means the service was not and will not be opened today

  • ALREADY_CLOSED means the service was open today but will not be open again

  • NO_DATA means opening hours of the service is unknown

text

string

Localised string of the data, eg. Closes soon at 17:00

isOpen

boolean

Boolean to indicate whether the service is currently open

timeData

{ time: string }

In case of OPENS_SOON and CLOSES_SOON statuses exact opening or closing time is provided in UTC time zone.

Example

JSON
{
    "openingHours": {
        "0": [
            {
                "start": "08:00",
                "finish": "12:00"
            },
            {
                "start": "16:00",
                "finish": "18:00"
            }
        ],
        "1": [
            {
                "start": "07:30",
                "finish": "12:00"
            },
            {
                "start": "16:00",
                "finish": "18:00"
            }
        ],
        "2": [
            {
                "start": "07:30",
                "finish": "12:00"
            }
        ],
        "3": [],
        "4": [
            {
                "start": "09:00",
                "finish": "12:00"
            }
        ],
        "5": [],
        "6": [],
        "detailedData": {
            "type": "ALREADY_CLOSED",
            "isOpen": false,
            "text": "Already closed"
        }
    }
}