# Happy hour card

> Canonical HTML: https://screenrig.ai/docs/cards/happy-hour/

Weekly happy-hour windows with a countdown: the specials at their happy price while one is on, and when the next one starts.

Category: Food and drink. Tags: Bars and pubs, Restaurants and cafes, Prices and rates, Countdowns and timers.

## Previews

![Happy hour](/cards/happy-hour/v1/screenshots/canvas-bloom.webp?sha=cfaf0823d12d3b90713a990347c920aabf2627189473234b0935a348d11204a1)

Canvas

![Happy hour](/cards/happy-hour/v1/screenshots/corner-bloom.webp?sha=772bf53bf98e3dda88072cd7f71093a64746c158b82884dee02cc88ed482084d)

Corner

![Happy hour](/cards/happy-hour/v1/screenshots/chip-bloom.webp?sha=b7800c3d462ff6356f085ccdab60cb76b47ef006b233b0319fda0ebcdd10b7ed)

Chip

## Views and forms

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

[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 | `"Happy hour"` | maxLength: `30` |  |
| `currency` | string | `"$"` | maxLength: `3` |  |
| `decimals` | number, string | `"auto"` | `"auto"`, `0`, `1`, `2` |  |
| `hour12` | boolean | `true` |  |  |
| `pageSeconds` | number | `10` | minimum: `5`; maximum: `120` |  |
| `footnote` | string | `""` | maxLength: `120` | A line along the foot, for example Dine-in only. |
| `timeZone` | string, null | `null` |  |  |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `windows` | array | `[{"days":["weekdays"],"start":"16:00","end":"18:00"},{"days":["fri","sat"],"start":"22:00","end":"00:00","label":"Late"}]` | maxItems: `8` | The weekly windows. |
| `windows[].days` | array |  | maxItems: `7` | mon to sun, or weekdays, weekends, daily. |
| `windows[].start` | string |  | maxLength: `5`; Required | HH:MM, 24-hour, in the screen's zone. |
| `windows[].end` | string |  | maxLength: `5`; Required | HH:MM; an end before the start runs past midnight. |
| `windows[].label` | string |  | maxLength: `24` |  |
| `specials` | array | `[{"name":"House lager, pint","price":5,"was":8,"note":"Draught, 20 oz"},{"name":"Well cocktails","price":7,"was":11,"note":"Rum, vodka, gin or whisky"},{"name":"Glass of house red or white","price":6,"was":10},{"name":"Chicken wings, six","price":9,"was":14,"note":"Hot, honey garlic or dry rub","badge":"Popular"},{"name":"Loaded nachos","price":10,"was":15,"note":"Share between two"}]` | maxItems: `24` | What is on special, at the happy price. |
| `specials[].name` | string |  | minLength: `1`; maxLength: `120`; Required |  |
| `specials[].note` | string |  | maxLength: `160` |  |
| `specials[].badge` | string |  | maxLength: `16` |  |
| `specials[].price` | number, null |  | minimum: `0` | The happy-hour price. |
| `specials[].was` | number, null |  | minimum: `0` | The regular price, struck through. |
| `specials[].priceLabel` | string |  | maxLength: `16` | Replaces the price, for example 2 for 10. |

## 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": "happy-hour",
  "primitive": "card",
  "card": "happy-hour",
  "major": 1,
  "params": {
    "theme": "neomustard"
  },
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "layer": 0,
  "content_fit": "fill",
  "data": "happy-hour-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/happy-hour-main" \
  --header "Authorization: Bearer $SCREENRIG_TOKEN" \
  --header "ScreenRig-Project: $SCREENRIG_PROJECT" \
  --header "Content-Type: application/json" \
  --data '{"document":{"windows":[{"days":["weekdays"],"start":"16:00","end":"18:00"},{"days":["fri","sat"],"start":"22:00","end":"00:00","label":"Late"}],"specials":[{"name":"House lager, pint","price":5,"was":8,"note":"Draught, 20 oz"},{"name":"Well cocktails","price":7,"was":11,"note":"Rum, vodka, gin or whisky"},{"name":"Glass of house red or white","price":6,"was":10},{"name":"Chicken wings, six","price":9,"was":14,"note":"Hot, honey garlic or dry rub","badge":"Popular"},{"name":"Loaded nachos","price":10,"was":15,"note":"Share between two"}]}}'
```
