Accent Fields Datetime

Time

A time of no particular day — opens-at and class times, padded and sortable.


A time of no particular day: `20:00`, produced by `time_picker` — the [Datetime](datetime.md) family's recurring method. Opens-at, last seating, the hour a class meets: facts about the clock, not the calendar.

Declaring one

Label Opens at
Key opens_at
Data type date
Editor time_picker

In the admin this is the Time field type.

The contract

HH:MM (seconds allowed), 24-hour, zero-padded — the form the native time input emits. The boundary refuses 24:00, 9:00, and 8pm where they enter: within-a-day sorting depends on every value being padded, and the API and agent lanes have no input control doing the padding for them.

An example

<% const [h, m] = cms.asset.content.opens_at.split(':').map(Number) %>
Doors at <%= ((h % 12) || 12) + ':' + String(m).padStart(2, '0')
             + (h < 12 ? ' AM' : ' PM') %>

Twelve-hour is a presentation choice, made at the print site — the stored form stays sortable.

When another method fits better

  • A specific eveningdate & time; a time field cannot say which Friday.
  • A span ("open 9–5") — two time fields (opens_at, closes_at); a range in one field is prose the template cannot compare.