From 6b6c60d9e5376b3a094189e4c42dd952ce57e6cf Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Mon, 29 Jan 2024 10:16:43 -0800 Subject: [PATCH] FIX #546 - Force Canadian Locale for Full Date Format We want a consistent YYYY-mm-dd HH::MM format here so setting.locale isn't desirable (e.g. en_US outputs mm-dd-YY) --- lib/models/redaction.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/models/redaction.dart b/lib/models/redaction.dart index 2fb3b2fd..506911e6 100644 --- a/lib/models/redaction.dart +++ b/lib/models/redaction.dart @@ -39,5 +39,7 @@ String prettyDateString(BuildContext context, DateTime date) { // } return AppLocalizations.of(context)!.now; } - return DateFormat.yMd(Platform.localeName).add_jm().format(date.toLocal()); + // note: explicitly overriding the 'locale' here to force + // a consistent YYYY-mm-dd HH::MM format. + return DateFormat.yMd('en_CA').add_jm().format(date.toLocal()); }