DateTimeIntlDateDisplayExtensions extension

Locale-correct calendar-date renderings (no clock). locale is an intl locale string (e.g. 'en_US', 'fr_FR'); null lets intl use its default.

on

Methods

dateDisplay({String monthFormat = 'MMM', bool showDayOrdinal = false, bool showCurrentYear = true, String? locale, DateTime? now}) String

Available on DateTime, provided by the DateTimeIntlDateDisplayExtensions extension

Display date like Jan 15, 1945 (or Jan 15th, 1945 with showDayOrdinal). When showCurrentYear is false, the year is omitted for dates in the current year (determined against now, injectable for tests).
formatByLocale({String? locale, bool ddMMyyFormat = false}) String?

Available on DateTime, provided by the DateTimeIntlDateDisplayExtensions extension

Locale short date: en_US 08/16/2023, en_GB/fr_FR 16/08/2023.
fullDateDisplay({String? locale}) String

Available on DateTime, provided by the DateTimeIntlDateDisplayExtensions extension

Locale-ordered full month name, day, year: January 15, 1945 (en_US), 15 janvier 1945 (fr_FR), 1945年1月15日 (ja_JP).
makeDisplayDate({bool showYear = true, bool showCurrentYear = false, bool showWeekday = true, String? locale, DateTime? now}) String?

Available on DateTime, provided by the DateTimeIntlDateDisplayExtensions extension

Display date with weekday like Thu, Jul 21, 2020 (locale-ordered).