Recipes
Locales
formatTime takes a BCP 47 locale and delegates to Intl.DateTimeFormat.
The same data, three different locales. ShadulerTimeColumn accepts locale (BCP 47) and timeFormat ('12h' | '24h'); both forward to formatTime which is a thin wrapper over Intl.DateTimeFormat.
en-US (12h)
de-DE (24h)
ja-JP (24h)
const START_HOUR = 8
const END_HOUR = 17
<ShadulerTimeColumn
startTime={START_HOUR}
endTime={END_HOUR}
timeFormat="12h"
locale="en-US"
/>formatTime is also exported — call it directly when you render time strings outside the time column (e.g. inside custom task content).
import { formatTime } from '@/components/ui/shaduler'
formatTime(540, { format: '24h', locale: 'de-DE' }) // → "09:00"
formatTime(540, { format: '12h', locale: 'en-US' }) // → "9:00 AM"
formatTime(540, { format: '24h', locale: 'ja-JP' }) // → "9:00"If you skip locale, the user's environment default is used.