Skip to main content

Date

Displays a date / time / timer. Uses iOS's Text(date:) API — the system refreshes it every second without any JS involvement.

Usage​

Tap the ➕ in the top-right of the editor and add date, then fill the date source into the "content" field.

What the content field accepts​

ContentMeaning
nowNow
tomorrowThis time tomorrow
yesterdayThis time yesterday
startoftodayToday at 00:00
2024-08-20 10:00:00A specific moment (format must be exact)
${ts}Placeholder — JS supplies a time string

Display styles​

The "style" field in the property panel decides how it renders:

StyleResult (using 14:30)
time2:30 PM clock
dateAugust 20, 2024 date
relative5 minutes ago relative time
offset+05:00 time offset
timer00:05:00 countdown / count-up

Example: countdown to a specific time​

this.target = "2026-01-01 00:00:00"

Date component:

  • Content: ${target}
  • Style: timer
  • → Displays the time remaining until New Year's Day 2026, auto-refreshing

Example: dynamic timer​

const tomorrow = new Date()
tomorrow.setDate(tomorrow.getDate() + 1)
tomorrow.setHours(0, 0, 0, 0)

const fmt = (d) => {
const p = (n) => String(n).padStart(2, "0")
return `${d.getFullYear()}-${p(d.getMonth()+1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`
}
this.next = fmt(tomorrow)

Set the date component's content to ${next} and style to timer — it shows a countdown to midnight tomorrow.

Why can date refresh every second?

Widgets can't refresh every second on their own, but Text(date:) is system-level — iOS drives this clock under the hood. For other "live" displays, see Live Activities.

About clipping​

The date component supports four-direction clipping (leading / trailing / top / bottom), which can produce effects like "show only the digits, hide the colon". This is for visual tweaking — feel free to skip it for everyday use.