TF-2773 Fix printing no year on the email date

This commit is contained in:
dab246
2024-04-04 11:59:33 +07:00
committed by Dat H. Pham
parent af0dc0cd86
commit 645de4508e
3 changed files with 11 additions and 2 deletions
@@ -1,4 +1,6 @@
import 'dart:ui';
extension DateTimeExtension on DateTime {
bool isToday() {
@@ -54,4 +56,12 @@ extension DateTimeNullableExtension on DateTime? {
return 'dd.MM.yyyy, HH:mm';
}
}
String toPatternForPrinting(String locale) {
if (locale == const Locale('en', 'US').toLanguageTag()) {
return 'MMM dd y, HH:mm';
} else {
return 'dd MMM y, HH:mm';
}
}
}