format method
Formats the date to the given format
@param pattern The pattern @returns The formatted date
String formattedDate = Moment.format("yyyy-mm-dd HH:mm");
Implementation
String format(String pattern, {String? localeOverride}) {
if (_useGlobalLocaleInFormat ||
_useLocaleInFormat ||
localeOverride != null)
return DateFormat(pattern, localeOverride ?? usedLocale.localeString)
.format(_date);
return DateFormat(pattern).format(_date);
}