datetime/date_format_preset_utils library

Dashboard date-format presets (short / medium / long) — roadmap #615.

This package deliberately avoids the heavyweight intl dependency, so localization is supplied by the caller through DateFormatNames rather than loaded from a locale database. The English names are the default; pass a localized DateFormatNames to render month and weekday names in any language while keeping the preset layout fixed.

Classes

DateFormatNames
Month and weekday names used by the medium/long presets, injectable so the presets can render in any language without a locale database.

Functions

formatDateLong(DateTime date, {DateFormatNames names = DateFormatNames.english}) String
Long preset: weekday, full month, day, year (e.g. Wednesday, June 10, 2026). Weekday and month names come from names, defaulting to English. Audited: 2026-06-12 11:26 EDT
formatDateMedium(DateTime date, {DateFormatNames names = DateFormatNames.english}) String
Medium preset: abbreviated month, day, year (e.g. Jun 10, 2026). Month name comes from names, defaulting to English. Audited: 2026-06-12 11:26 EDT
formatDateShort(DateTime date) String
Short preset: unambiguous ISO-8601 calendar date yyyy-MM-dd (e.g. 2026-06-10). No names, so it is locale-independent and sorts lexically — ideal for compact dashboard columns. Audited: 2026-06-12 11:26 EDT