Skip to main content
Our new developer certification is live!

DateDisplay

Displays formatted publication and update dates for content.

Props

PropTypeRequiredDefaultDescription
publishedAtstringNo-ISO date string for published date
updatedAtstringNo-ISO date string for updated date
classNamestringNo''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 formatCardDate utility (e.g., "Jan 15, 2024")
  • Shows "Updated [date]" if updatedAt differs from publishedAt
  • Uses semantic <time> elements with dateTime attributes
  • Returns null if 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-body typography variant
  • Separates dates with bullet (•) character