Use day-first written dates and 24-hour chat timestamps
This commit is contained in:
@@ -31,23 +31,16 @@ class ChatMessageTimestamp extends StatelessWidget {
|
||||
if (material != null) {
|
||||
time = material.formatTimeOfDay(
|
||||
TimeOfDay.fromDateTime(instant),
|
||||
alwaysUse24HourFormat: MediaQuery.alwaysUse24HourFormatOf(context),
|
||||
alwaysUse24HourFormat: true,
|
||||
);
|
||||
date = material.formatCompactDate(instant);
|
||||
full = '${material.formatFullDate(instant)}, $time';
|
||||
date = '${instant.day} ${material.formatMonthYear(instant)}';
|
||||
full = '$date, $time';
|
||||
} else {
|
||||
final local = CupertinoLocalizations.of(context);
|
||||
final use24 = MediaQuery.alwaysUse24HourFormatOf(context);
|
||||
final hour = use24
|
||||
? instant.hour
|
||||
: (instant.hour % 12 == 0 ? 12 : instant.hour % 12);
|
||||
final period = use24
|
||||
? ''
|
||||
: ' ${instant.hour < 12 ? local.anteMeridiemAbbreviation : local.postMeridiemAbbreviation}';
|
||||
time =
|
||||
'${local.datePickerHour(hour)}:${local.datePickerMinute(instant.minute)}$period';
|
||||
'${local.datePickerHour(instant.hour).padLeft(2, '0')}:${local.datePickerMinute(instant.minute)}';
|
||||
date =
|
||||
'${local.datePickerMediumDate(instant)} ${local.datePickerYear(instant.year)}';
|
||||
'${local.datePickerDayOfMonth(instant.day)} ${local.datePickerMonth(instant.month)} ${local.datePickerYear(instant.year)}';
|
||||
full = '$date, $time';
|
||||
}
|
||||
final style =
|
||||
|
||||
Reference in New Issue
Block a user