# Opening hours card

> Canonical HTML: https://screenrig.ai/docs/cards/opening-hours/

Open or closed at a glance, when that changes, and the week's hours with today marked and holiday exceptions.

Category: Retail. Tags: Schedules, Stores, Restaurants and cafes, Healthcare.

## Previews

![Opening hours](/cards/opening-hours/v1/screenshots/canvas-bloom.webp?sha=c4f62aed82b4c75ea1344928216b906dd79dd8c7b24c9033030100c35bd5f969)

Canvas

![Opening hours](/cards/opening-hours/v1/screenshots/corner-bloom.webp?sha=48fcfbb946c34be36988c735216c891f4ed6a5d461f283fc8f1884c159453330)

Corner

![Opening hours](/cards/opening-hours/v1/screenshots/chip-bloom.webp?sha=3231dbb73a361f7257a9dcc9bf024bd5d5dd8925c34694d4963f8df8185a0f47)

Chip

## Views and forms

Views: canvas, corner, chip. Canvas forms: landscape, portrait.

[Card views, themes and publishing](/docs/cards/). [Browse the gallery](/apps/#cards).

## Data and privacy

This card uses its configured properties and live card data.

## Properties

For theme, background, accent and position, see [Common properties](/docs/cards/#common-properties).

Set static properties in `params`. Bind `data` to a project card data key for live values; that document holds only dynamic properties. Without a data key, put the complete configuration in `params`. Nested rows describe the contents of their parent property.

### Static properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `title` | string | `""` | maxLength: `40` |  |
| `hour12` | boolean | `false` |  |  |
| `closingSoonMinutes` | integer | `30` | minimum: `0`; maximum: `180` | Minutes before closing (or opening) that the status turns to closing soon (opening soon). |
| `timeZone` | string, null | `null` |  |  |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `hours` | object |  | additionalProperties: `false`; Required | Each weekday's open ranges; a missing or empty day is closed. |
| `hours.mon` | array | `[]` | maxItems: `4` |  |
| `hours.mon[].open` | string |  | pattern: `"^([01]\\d\|2[0-3]):[0-5]\\d$"`; Required |  |
| `hours.mon[].close` | string |  | pattern: `"^(([01]\\d\|2[0-3]):[0-5]\\d\|24:00)$"`; Required | At or before open runs past midnight; 24:00 is the end of the day. |
| `hours.tue` | array | `[]` | maxItems: `4` |  |
| `hours.tue[].open` | string |  | pattern: `"^([01]\\d\|2[0-3]):[0-5]\\d$"`; Required |  |
| `hours.tue[].close` | string |  | pattern: `"^(([01]\\d\|2[0-3]):[0-5]\\d\|24:00)$"`; Required | At or before open runs past midnight; 24:00 is the end of the day. |
| `hours.wed` | array | `[]` | maxItems: `4` |  |
| `hours.wed[].open` | string |  | pattern: `"^([01]\\d\|2[0-3]):[0-5]\\d$"`; Required |  |
| `hours.wed[].close` | string |  | pattern: `"^(([01]\\d\|2[0-3]):[0-5]\\d\|24:00)$"`; Required | At or before open runs past midnight; 24:00 is the end of the day. |
| `hours.thu` | array | `[]` | maxItems: `4` |  |
| `hours.thu[].open` | string |  | pattern: `"^([01]\\d\|2[0-3]):[0-5]\\d$"`; Required |  |
| `hours.thu[].close` | string |  | pattern: `"^(([01]\\d\|2[0-3]):[0-5]\\d\|24:00)$"`; Required | At or before open runs past midnight; 24:00 is the end of the day. |
| `hours.fri` | array | `[]` | maxItems: `4` |  |
| `hours.fri[].open` | string |  | pattern: `"^([01]\\d\|2[0-3]):[0-5]\\d$"`; Required |  |
| `hours.fri[].close` | string |  | pattern: `"^(([01]\\d\|2[0-3]):[0-5]\\d\|24:00)$"`; Required | At or before open runs past midnight; 24:00 is the end of the day. |
| `hours.sat` | array | `[]` | maxItems: `4` |  |
| `hours.sat[].open` | string |  | pattern: `"^([01]\\d\|2[0-3]):[0-5]\\d$"`; Required |  |
| `hours.sat[].close` | string |  | pattern: `"^(([01]\\d\|2[0-3]):[0-5]\\d\|24:00)$"`; Required | At or before open runs past midnight; 24:00 is the end of the day. |
| `hours.sun` | array | `[]` | maxItems: `4` |  |
| `hours.sun[].open` | string |  | pattern: `"^([01]\\d\|2[0-3]):[0-5]\\d$"`; Required |  |
| `hours.sun[].close` | string |  | pattern: `"^(([01]\\d\|2[0-3]):[0-5]\\d\|24:00)$"`; Required | At or before open runs past midnight; 24:00 is the end of the day. |
| `exceptions` | array | `[]` | maxItems: `40` |  |
| `exceptions[].date` | string |  | pattern: `"^\\d{4}-\\d{2}-\\d{2}$"`; Required |  |
| `exceptions[].closed` | boolean | `false` |  |  |
| `exceptions[].ranges` | array | `[]` | maxItems: `4` |  |
| `exceptions[].ranges[].open` | string |  | pattern: `"^([01]\\d\|2[0-3]):[0-5]\\d$"`; Required |  |
| `exceptions[].ranges[].close` | string |  | pattern: `"^(([01]\\d\|2[0-3]):[0-5]\\d\|24:00)$"`; Required | At or before open runs past midnight; 24:00 is the end of the day. |
| `exceptions[].note` | string | `""` | maxLength: `40` |  |

## Canvas example

Add this item to a playlist page’s `primitives`. [Publish the playlist and assign a screen](/docs/cards/#publish-a-card-canvas).

```json
{
  "id": "opening-hours",
  "primitive": "card",
  "card": "opening-hours",
  "major": 1,
  "params": {
    "theme": "neomustard"
  },
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "layer": 0,
  "content_fit": "fill",
  "data": "opening-hours-main"
}
```

## Write live data

Create this document before showing the card, then replace it to update the screen without republishing. Use the same project as the playlist. Supply your API authorization through the environment; see [API authentication](/docs/authentication/).

```console
curl --request PUT "https://api.screenrig.ai/api/card-data/opening-hours-main" \
  --header "Authorization: Bearer $SCREENRIG_TOKEN" \
  --header "ScreenRig-Project: $SCREENRIG_PROJECT" \
  --header "Content-Type: application/json" \
  --data '{"document":{"hours":{},"exceptions":[]}}'
```
