TF-2713 Small evolution for printing
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:core/domain/extensions/datetime_extension.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/properties/properties.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
@@ -44,6 +45,17 @@ extension EmailExtension on Email {
|
||||
mailboxCurrent?.isSent == false;
|
||||
}
|
||||
|
||||
String getReceivedAt({required String newLocale, String? pattern}) {
|
||||
log('EmailExtension::getReceivedAt: newLocale = $newLocale | pattern = $pattern');
|
||||
if (receivedAt != null) {
|
||||
return receivedAt!.formatDateToLocal(
|
||||
pattern: pattern ?? receivedAt!.value.toLocal().toPattern(),
|
||||
locale: newLocale
|
||||
);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
Set<String> getRecipientEmailAddressList() {
|
||||
final listEmailAddress = <String>{};
|
||||
final listToAddress = to.getListAddress() ?? [];
|
||||
|
||||
@@ -29,6 +29,7 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
int numberOfAllEmailAddress() => to.numberEmailAddress() + cc.numberEmailAddress() + bcc.numberEmailAddress();
|
||||
|
||||
String getReceivedAt(String newLocale, {String? pattern}) {
|
||||
log('PresentationEmailExtension::getReceivedAt: newLocale = $newLocale | pattern = $pattern');
|
||||
final emailTime = receivedAt;
|
||||
if (emailTime != null) {
|
||||
return emailTime.formatDateToLocal(
|
||||
|
||||
Reference in New Issue
Block a user