TF-46 Compose email for Reply, Forward from EmailView
This commit is contained in:
@@ -1,22 +1,10 @@
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:core/core.dart';
|
||||
|
||||
extension PresentationEmailExtension on PresentationEmail {
|
||||
|
||||
String getTimeSentEmail(String locale) {
|
||||
if (sentAt != null) {
|
||||
if (sentAt!.value.isToday()) {
|
||||
return DateFormat('h:mm a', locale).format(sentAt!.value);
|
||||
} else if (sentAt!.value.isYesterday()) {
|
||||
return DateFormat('EEE', locale).format(sentAt!.value);
|
||||
} else if (sentAt!.value.isThisYear()) {
|
||||
return DateFormat('MMMd', locale).format(sentAt!.value);
|
||||
} else {
|
||||
return DateFormat('yMMMd', locale).format(sentAt!.value);
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
String getTimeSentEmail(String newLocale) {
|
||||
final dateTime = sentAt?.value;
|
||||
return sentAt.formatDate(pattern: dateTime.toPattern(), locale: newLocale);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user