TF-113 [BUG] Date should be display in the local time zone
This commit is contained in:
@@ -9,7 +9,9 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
String getEmailDateTime(String newLocale, {String? pattern}) {
|
||||
final emailTime = sentAt ?? receivedAt;
|
||||
if (emailTime != null) {
|
||||
return emailTime.formatDate(pattern: pattern ?? emailTime.value.toPattern(), locale: newLocale);
|
||||
return emailTime.formatDate(
|
||||
pattern: pattern ?? emailTime.value.toLocal().toPattern(),
|
||||
locale: newLocale);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ extension UTCDateExtension on UTCDate? {
|
||||
|
||||
String formatDate({String pattern = 'yMMMd', String locale = 'en_US'}) {
|
||||
if (this != null) {
|
||||
return DateFormat(pattern, locale).format(this!.value);
|
||||
return DateFormat(pattern, locale).format(this!.value.toLocal());
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user