Summary

  • AdapTable provides a number of Display Formats to be used with Date Columns

Users can use the Date Formatter to set their own date pattern (or select one of the presets).

The object has a single Pattern property:

PropertyTypeDescription
PatternstringPattern to use for Date Format

Find Out More

Find the full list of available DateTime patterns at the unicode website

Date Presets

Similar to numeric columns, AdapTable provides some presets for commonly used Date Formats:

PresetExample (using 5 August 2023 at 10:30pm)
MM/dd/yyyy08/05/2023
dd-MM-yyyyy05-08-2023
MMMM do yyyy, h:mm:ss aAugust 5th 2023, 10:30:00 PM
EEEESaturday
MMM do yyyyAug 5th 2023
yyyyMMdd20230805
HH:mm:ss22:30:00
Column Formatting: Date Display Formats
Fork
  • This example shows 3 different Date Formats
    • Created has a format of 'yyyy/MM/dd'
    • Updated has a format of 'MMM do yyyy'
    • Pushed has a format of 'EEEE'

Expand to see the Date Display Formats

FAQ

Can we show only the time portion of a date? Yes. Set Pattern to a time-only pattern such as HH:mm:ss (also available as a wizard preset).

How do we set a custom date layout? Set DisplayFormat to { Formatter: 'DateFormatter', Options: { Pattern: '…' } } }. Pattern letters follow the Unicode date field symbols table linked above.

Are date presets the same as numeric presets? No. Date wizard presets are shortcuts that fill in Pattern; there is no DisplayFormat: 'ShortDate' style name in state. Numeric columns can use preset names directly in DisplayFormat.