DateDisplay
Displays formatted publication and update dates for content.
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
publishedAt | string | No | - | ISO date string for published date |
updatedAt | string | No | - | ISO date string for updated date |
className | string | No | '' | Additional CSS classes |
Usage
import DateDisplay from '@/components/atoms/DateDisplay';
<DateDisplay
publishedAt="2024-01-15T10:00:00Z"
updatedAt="2024-01-20T14:30:00Z"
/>Features
- Formats dates using
formatCardDateutility (e.g., "Jan 15, 2024") - Shows "Updated [date]" if updatedAt differs from publishedAt
- Uses semantic
<time>elements withdateTimeattributes - Returns
nullif no publishedAt date is provided - Uppercase, tracked text styling
Date Format
Dates are formatted as: "MMM DD, YYYY" (e.g., "Jan 15, 2024")
Notes
- Only shows updated date if it's different from published date
- Uses
cs-xs-bodytypography variant - Separates dates with bullet (•) character