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}) {
|
String getEmailDateTime(String newLocale, {String? pattern}) {
|
||||||
final emailTime = sentAt ?? receivedAt;
|
final emailTime = sentAt ?? receivedAt;
|
||||||
if (emailTime != null) {
|
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 '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ extension UTCDateExtension on UTCDate? {
|
|||||||
|
|
||||||
String formatDate({String pattern = 'yMMMd', String locale = 'en_US'}) {
|
String formatDate({String pattern = 'yMMMd', String locale = 'en_US'}) {
|
||||||
if (this != null) {
|
if (this != null) {
|
||||||
return DateFormat(pattern, locale).format(this!.value);
|
return DateFormat(pattern, locale).format(this!.value.toLocal());
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user