TF-113 [BUG] Date should be display in the local time zone

This commit is contained in:
dab246
2021-10-04 11:44:04 +07:00
committed by Dat H. Pham
parent d8aac0ba69
commit c475820353
2 changed files with 4 additions and 2 deletions
@@ -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 '';
}
+1 -1
View File
@@ -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 '';
}