Stele - Dates and Times

Components
CurrencyDates and TimesBasic UsageExample messagePropsPlaygroundNumbersPluralSelectSelect Ordinal
HomeHow Stele Works
How To
LicenseTechdebt

Dates and Times

Dates and Times get formatted differently based on your locale. Fortunately, we have the Intl spec which allows us to use non-locale specific

Basic Usage

import * as React from 'react'
import { DateTime } from '@patreon/stele'
function MyComponent(props) {
return (
<Text intl>
Parks and Rec first aired on{' '}
<DateTime
value={props.parksAndRecStartedAt}
type={DateTime.Type.Date}
/>
</Text>
)
}

Example message

{
parksAndRecStartedAt, date, medium
}

Props

format
"short" | "medium" | "long" | "full" | "hourOfDay" | "monthOnly" | "monthWithDay" | "shortMonthShortDay" | "mediumMonthShortDay" | "fullMonthShortDay" | "mediumMonthWithYear" | "longMonthWithYear" | undefined
type
Type
required
value
Date
required

Playground



Parks and Rec first aired on 10/10/22

It is now 7:17 PM

© Patreon