Opening hours card

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
Canvas
Opening hours
Corner
Opening hours
Chip

Views and forms

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

Card views, themes and publishing. Browse the gallery.

Data and privacy

This card uses its configured properties and live card data.

Properties

For theme, background, accent and position, see 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

NameTypeDefaultValues and limitsDescription
titlestring""maxLength: 40
hour12booleanfalse
closingSoonMinutesinteger30minimum: 0; maximum: 180Minutes before closing (or opening) that the status turns to closing soon (opening soon).
timeZonestring, nullnull

Dynamic properties

NameTypeDefaultValues and limitsDescription
hoursobjectadditionalProperties: false; RequiredEach weekday's open ranges; a missing or empty day is closed.
hours.monarray[]maxItems: 4
hours.mon[].openstringpattern: "^([01]\\d|2[0-3]):[0-5]\\d$"; Required
hours.mon[].closestringpattern: "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"; RequiredAt or before open runs past midnight; 24:00 is the end of the day.
hours.tuearray[]maxItems: 4
hours.tue[].openstringpattern: "^([01]\\d|2[0-3]):[0-5]\\d$"; Required
hours.tue[].closestringpattern: "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"; RequiredAt or before open runs past midnight; 24:00 is the end of the day.
hours.wedarray[]maxItems: 4
hours.wed[].openstringpattern: "^([01]\\d|2[0-3]):[0-5]\\d$"; Required
hours.wed[].closestringpattern: "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"; RequiredAt or before open runs past midnight; 24:00 is the end of the day.
hours.thuarray[]maxItems: 4
hours.thu[].openstringpattern: "^([01]\\d|2[0-3]):[0-5]\\d$"; Required
hours.thu[].closestringpattern: "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"; RequiredAt or before open runs past midnight; 24:00 is the end of the day.
hours.friarray[]maxItems: 4
hours.fri[].openstringpattern: "^([01]\\d|2[0-3]):[0-5]\\d$"; Required
hours.fri[].closestringpattern: "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"; RequiredAt or before open runs past midnight; 24:00 is the end of the day.
hours.satarray[]maxItems: 4
hours.sat[].openstringpattern: "^([01]\\d|2[0-3]):[0-5]\\d$"; Required
hours.sat[].closestringpattern: "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"; RequiredAt or before open runs past midnight; 24:00 is the end of the day.
hours.sunarray[]maxItems: 4
hours.sun[].openstringpattern: "^([01]\\d|2[0-3]):[0-5]\\d$"; Required
hours.sun[].closestringpattern: "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"; RequiredAt or before open runs past midnight; 24:00 is the end of the day.
exceptionsarray[]maxItems: 40
exceptions[].datestringpattern: "^\\d{4}-\\d{2}-\\d{2}$"; Required
exceptions[].closedbooleanfalse
exceptions[].rangesarray[]maxItems: 4
exceptions[].ranges[].openstringpattern: "^([01]\\d|2[0-3]):[0-5]\\d$"; Required
exceptions[].ranges[].closestringpattern: "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$"; RequiredAt or before open runs past midnight; 24:00 is the end of the day.
exceptions[].notestring""maxLength: 40

Canvas example

Add this item to a playlist page’s primitives. Publish the playlist and assign a screen.

{
  "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.

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":[]}}'