From 0639ac473b9aa7e3ac1f6899d1566af36151bf83 Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Tue, 30 Dec 2025 13:32:53 -0600 Subject: [PATCH 01/19] Try internationalizing --- w_common/lib/time.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/w_common/lib/time.dart b/w_common/lib/time.dart index dcf94e24..79e0ed9e 100644 --- a/w_common/lib/time.dart +++ b/w_common/lib/time.dart @@ -3,16 +3,16 @@ library w_common.timestamp; import 'package:intl/intl.dart'; /// The format of a timestamp with no date. -DateFormat timeFormat = DateFormat('h:mma'); +DateFormat timeFormat = DateFormat('h:mma', Intl.getCurrentLocale()); /// The format of a weekday with no time of day. -DateFormat weekdayFormat = DateFormat.EEEE(); +DateFormat weekdayFormat = DateFormat.EEEE(Intl.getCurrentLocale()); /// The format of a month and day with no time of day. -DateFormat monthDayFormat = DateFormat.MMMMd(); +DateFormat monthDayFormat = DateFormat.MMMMd(Intl.getCurrentLocale()); /// The format of the full date with no time of day. -DateFormat yearMonthDayFormat = DateFormat.yMMMd(); +DateFormat yearMonthDayFormat = DateFormat.yMMMd(Intl.getCurrentLocale()); /// Formats a DateTime into the 'X ago' string format. String formatTimeDifference(DateTime time, {DateTime? now}) { @@ -22,12 +22,12 @@ String formatTimeDifference(DateTime time, {DateTime? now}) { if (deltaDays < 1 && now.day == time.day) { // "Today, XX:XXam" - return 'Today, $timeOfDay'; + return '${Intl.message('Today')}, $timeOfDay'; } if (deltaDays < 2 && now.weekday == (time.weekday + 1) % 7) { // "Yesterday, XX:XXam" - return 'Yesterday, $timeOfDay'; + return '${Intl.message('Yesterday')}, $timeOfDay'; } // Weekday check prevents ambiguity between dates that are From c9f6a85507010fa251b0cd6644eab1705f6e266e Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Tue, 30 Dec 2025 16:05:19 -0600 Subject: [PATCH 02/19] local variable --- w_common/lib/time.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/w_common/lib/time.dart b/w_common/lib/time.dart index 79e0ed9e..b25cabaa 100644 --- a/w_common/lib/time.dart +++ b/w_common/lib/time.dart @@ -2,17 +2,19 @@ library w_common.timestamp; import 'package:intl/intl.dart'; +final locale = Intl.getCurrentLocale(); + /// The format of a timestamp with no date. -DateFormat timeFormat = DateFormat('h:mma', Intl.getCurrentLocale()); +DateFormat timeFormat = DateFormat('h:mma', locale); /// The format of a weekday with no time of day. -DateFormat weekdayFormat = DateFormat.EEEE(Intl.getCurrentLocale()); +DateFormat weekdayFormat = DateFormat.EEEE(locale); /// The format of a month and day with no time of day. -DateFormat monthDayFormat = DateFormat.MMMMd(Intl.getCurrentLocale()); +DateFormat monthDayFormat = DateFormat.MMMMd(locale); /// The format of the full date with no time of day. -DateFormat yearMonthDayFormat = DateFormat.yMMMd(Intl.getCurrentLocale()); +DateFormat yearMonthDayFormat = DateFormat.yMMMd(locale); /// Formats a DateTime into the 'X ago' string format. String formatTimeDifference(DateTime time, {DateTime? now}) { From f0fa5a7c350b5743630aedc5c11221de6e9fa7ca Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Tue, 30 Dec 2025 17:04:08 -0600 Subject: [PATCH 03/19] downgrade ci version --- .github/workflows/dart_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index 56756c05..241cb9fe 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [ 2.19.6, stable ] + sdk: [ 2.19.6, 3.9.4 ] steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1 From 937cca99861126dbc732d624b351548192379c6b Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Tue, 30 Dec 2025 17:44:43 -0600 Subject: [PATCH 04/19] use w_intl --- w_common/lib/src/intl/time_intl.dart | 7 +++++++ w_common/lib/time.dart | 5 +++-- w_common/pubspec.yaml | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 w_common/lib/src/intl/time_intl.dart diff --git a/w_common/lib/src/intl/time_intl.dart b/w_common/lib/src/intl/time_intl.dart new file mode 100644 index 00000000..ba9d3d8c --- /dev/null +++ b/w_common/lib/src/intl/time_intl.dart @@ -0,0 +1,7 @@ +import 'package:w_intl/intl_wrapper.dart'; + +class TimeIntl { + static String get today => Intl.message('Today', name: 'TimeIntl_today'); + + static String get yesterday => Intl.message('Yesterday', name: 'TimeIntl_yesterday'); +} \ No newline at end of file diff --git a/w_common/lib/time.dart b/w_common/lib/time.dart index b25cabaa..2de7a0f7 100644 --- a/w_common/lib/time.dart +++ b/w_common/lib/time.dart @@ -1,6 +1,7 @@ library w_common.timestamp; import 'package:intl/intl.dart'; +import 'package:w_common/src/intl/time_intl.dart'; final locale = Intl.getCurrentLocale(); @@ -24,12 +25,12 @@ String formatTimeDifference(DateTime time, {DateTime? now}) { if (deltaDays < 1 && now.day == time.day) { // "Today, XX:XXam" - return '${Intl.message('Today')}, $timeOfDay'; + return '${TimeIntl.today}, $timeOfDay'; } if (deltaDays < 2 && now.weekday == (time.weekday + 1) % 7) { // "Yesterday, XX:XXam" - return '${Intl.message('Yesterday')}, $timeOfDay'; + return '${TimeIntl.yesterday}, $timeOfDay'; } // Weekday check prevents ambiguity between dates that are diff --git a/w_common/pubspec.yaml b/w_common/pubspec.yaml index 27249057..7eea36fd 100644 --- a/w_common/pubspec.yaml +++ b/w_common/pubspec.yaml @@ -17,3 +17,9 @@ dev_dependencies: mocktail: ^1.0.4 test: ^1.21.1 workiva_analysis_options: ^1.4.2 + + # hosted dependencies + w_intl: + hosted: + name: w_intl + url: https://pub.workiva.org From 313efe4fb33a13ab4c512973524758042931f8ee Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Tue, 30 Dec 2025 17:47:46 -0600 Subject: [PATCH 05/19] add version --- w_common/pubspec.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/w_common/pubspec.yaml b/w_common/pubspec.yaml index 7eea36fd..1adc19c8 100644 --- a/w_common/pubspec.yaml +++ b/w_common/pubspec.yaml @@ -23,3 +23,4 @@ dev_dependencies: hosted: name: w_intl url: https://pub.workiva.org + version: ^2.26.57 From b836320889042ce808b788911b8589395caf7d1f Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Tue, 30 Dec 2025 17:52:00 -0600 Subject: [PATCH 06/19] dont add external dependency --- w_common/lib/src/intl/time_intl.dart | 7 +++++++ w_common/lib/time.dart | 5 +++-- w_common/pubspec.yaml | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 w_common/lib/src/intl/time_intl.dart diff --git a/w_common/lib/src/intl/time_intl.dart b/w_common/lib/src/intl/time_intl.dart new file mode 100644 index 00000000..ba9d3d8c --- /dev/null +++ b/w_common/lib/src/intl/time_intl.dart @@ -0,0 +1,7 @@ +import 'package:w_intl/intl_wrapper.dart'; + +class TimeIntl { + static String get today => Intl.message('Today', name: 'TimeIntl_today'); + + static String get yesterday => Intl.message('Yesterday', name: 'TimeIntl_yesterday'); +} \ No newline at end of file diff --git a/w_common/lib/time.dart b/w_common/lib/time.dart index b25cabaa..2de7a0f7 100644 --- a/w_common/lib/time.dart +++ b/w_common/lib/time.dart @@ -1,6 +1,7 @@ library w_common.timestamp; import 'package:intl/intl.dart'; +import 'package:w_common/src/intl/time_intl.dart'; final locale = Intl.getCurrentLocale(); @@ -24,12 +25,12 @@ String formatTimeDifference(DateTime time, {DateTime? now}) { if (deltaDays < 1 && now.day == time.day) { // "Today, XX:XXam" - return '${Intl.message('Today')}, $timeOfDay'; + return '${TimeIntl.today}, $timeOfDay'; } if (deltaDays < 2 && now.weekday == (time.weekday + 1) % 7) { // "Yesterday, XX:XXam" - return '${Intl.message('Yesterday')}, $timeOfDay'; + return '${TimeIntl.yesterday}, $timeOfDay'; } // Weekday check prevents ambiguity between dates that are diff --git a/w_common/pubspec.yaml b/w_common/pubspec.yaml index 27249057..7eea36fd 100644 --- a/w_common/pubspec.yaml +++ b/w_common/pubspec.yaml @@ -17,3 +17,9 @@ dev_dependencies: mocktail: ^1.0.4 test: ^1.21.1 workiva_analysis_options: ^1.4.2 + + # hosted dependencies + w_intl: + hosted: + name: w_intl + url: https://pub.workiva.org From d206e1d703e8540e11fea1af53bb9f0ee46f9a9e Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Tue, 30 Dec 2025 17:54:21 -0600 Subject: [PATCH 07/19] dont add external dependency --- w_common/lib/src/intl/time_intl.dart | 7 ------- w_common/lib/time.dart | 5 ++--- w_common/pubspec.yaml | 6 ------ 3 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 w_common/lib/src/intl/time_intl.dart diff --git a/w_common/lib/src/intl/time_intl.dart b/w_common/lib/src/intl/time_intl.dart deleted file mode 100644 index ba9d3d8c..00000000 --- a/w_common/lib/src/intl/time_intl.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:w_intl/intl_wrapper.dart'; - -class TimeIntl { - static String get today => Intl.message('Today', name: 'TimeIntl_today'); - - static String get yesterday => Intl.message('Yesterday', name: 'TimeIntl_yesterday'); -} \ No newline at end of file diff --git a/w_common/lib/time.dart b/w_common/lib/time.dart index 2de7a0f7..b25cabaa 100644 --- a/w_common/lib/time.dart +++ b/w_common/lib/time.dart @@ -1,7 +1,6 @@ library w_common.timestamp; import 'package:intl/intl.dart'; -import 'package:w_common/src/intl/time_intl.dart'; final locale = Intl.getCurrentLocale(); @@ -25,12 +24,12 @@ String formatTimeDifference(DateTime time, {DateTime? now}) { if (deltaDays < 1 && now.day == time.day) { // "Today, XX:XXam" - return '${TimeIntl.today}, $timeOfDay'; + return '${Intl.message('Today')}, $timeOfDay'; } if (deltaDays < 2 && now.weekday == (time.weekday + 1) % 7) { // "Yesterday, XX:XXam" - return '${TimeIntl.yesterday}, $timeOfDay'; + return '${Intl.message('Yesterday')}, $timeOfDay'; } // Weekday check prevents ambiguity between dates that are diff --git a/w_common/pubspec.yaml b/w_common/pubspec.yaml index 7eea36fd..27249057 100644 --- a/w_common/pubspec.yaml +++ b/w_common/pubspec.yaml @@ -17,9 +17,3 @@ dev_dependencies: mocktail: ^1.0.4 test: ^1.21.1 workiva_analysis_options: ^1.4.2 - - # hosted dependencies - w_intl: - hosted: - name: w_intl - url: https://pub.workiva.org From 3ac6088f690f3a06eb20e93efe1ef3af7367f185 Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Mon, 5 Jan 2026 09:04:55 -0600 Subject: [PATCH 08/19] upgrade analysis options --- .github/workflows/dart_ci.yml | 2 +- w_common/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index 241cb9fe..56756c05 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [ 2.19.6, 3.9.4 ] + sdk: [ 2.19.6, stable ] steps: - uses: actions/checkout@v2 - uses: dart-lang/setup-dart@v1 diff --git a/w_common/pubspec.yaml b/w_common/pubspec.yaml index 27249057..6aaf4979 100644 --- a/w_common/pubspec.yaml +++ b/w_common/pubspec.yaml @@ -16,4 +16,4 @@ dev_dependencies: dependency_validator: ^3.0.0 mocktail: ^1.0.4 test: ^1.21.1 - workiva_analysis_options: ^1.4.2 + workiva_analysis_options: ^1.4.3 From 57cee430c2fcdab925bf79029e8c06bca989f442 Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Mon, 5 Jan 2026 09:25:55 -0600 Subject: [PATCH 09/19] w_common_tools too --- w_common_tools/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/w_common_tools/pubspec.yaml b/w_common_tools/pubspec.yaml index 81def42b..9e80ae86 100644 --- a/w_common_tools/pubspec.yaml +++ b/w_common_tools/pubspec.yaml @@ -20,4 +20,4 @@ dev_dependencies: build_web_compilers: '>=2.16.5 <5.0.0' dependency_validator: ^3.0.0 test: ^1.21.1 - workiva_analysis_options: ^1.0.0 + workiva_analysis_options: ^1.4.3 From 945c72fb1937385783d375ee04ccbe871562b46b Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Mon, 5 Jan 2026 09:42:31 -0600 Subject: [PATCH 10/19] follow workiva_analysis_options consumption pattern --- w_common/pubspec.yaml | 2 +- w_common_tools/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/w_common/pubspec.yaml b/w_common/pubspec.yaml index 6aaf4979..c2e8211f 100644 --- a/w_common/pubspec.yaml +++ b/w_common/pubspec.yaml @@ -16,4 +16,4 @@ dev_dependencies: dependency_validator: ^3.0.0 mocktail: ^1.0.4 test: ^1.21.1 - workiva_analysis_options: ^1.4.3 + workiva_analysis_options: ^1.0.0 diff --git a/w_common_tools/pubspec.yaml b/w_common_tools/pubspec.yaml index 9e80ae86..81def42b 100644 --- a/w_common_tools/pubspec.yaml +++ b/w_common_tools/pubspec.yaml @@ -20,4 +20,4 @@ dev_dependencies: build_web_compilers: '>=2.16.5 <5.0.0' dependency_validator: ^3.0.0 test: ^1.21.1 - workiva_analysis_options: ^1.4.3 + workiva_analysis_options: ^1.0.0 From 0502aa805ec350c2bc6dd4a5227423063dea97d2 Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Mon, 5 Jan 2026 13:23:52 -0600 Subject: [PATCH 11/19] wait to pull in latest analysis options --- w_common/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/w_common/pubspec.yaml b/w_common/pubspec.yaml index c2e8211f..27249057 100644 --- a/w_common/pubspec.yaml +++ b/w_common/pubspec.yaml @@ -16,4 +16,4 @@ dev_dependencies: dependency_validator: ^3.0.0 mocktail: ^1.0.4 test: ^1.21.1 - workiva_analysis_options: ^1.0.0 + workiva_analysis_options: ^1.4.2 From 918cc14d21a0f28c8db93d1525e5bcc5b22c9d12 Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Mon, 5 Jan 2026 15:20:16 -0600 Subject: [PATCH 12/19] define translated strings in a separate file --- w_common/lib/src/intl/time_intl.dart | 7 +++++++ w_common/pubspec.yaml | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 w_common/lib/src/intl/time_intl.dart diff --git a/w_common/lib/src/intl/time_intl.dart b/w_common/lib/src/intl/time_intl.dart new file mode 100644 index 00000000..acc11dd7 --- /dev/null +++ b/w_common/lib/src/intl/time_intl.dart @@ -0,0 +1,7 @@ +import 'package:w_intl/intl_wrapper.dart'; + +class TimeIntl { + static String get today => Intl.message('Today', name: 'TimeIntl_today'); + + static String get yesterday => Intl.message('Yesterday', name: 'TimeIntl_yesterday'); +} diff --git a/w_common/pubspec.yaml b/w_common/pubspec.yaml index 27249057..7eea36fd 100644 --- a/w_common/pubspec.yaml +++ b/w_common/pubspec.yaml @@ -17,3 +17,9 @@ dev_dependencies: mocktail: ^1.0.4 test: ^1.21.1 workiva_analysis_options: ^1.4.2 + + # hosted dependencies + w_intl: + hosted: + name: w_intl + url: https://pub.workiva.org From a5f519ec92bc7c890710559b2b8ad74991d29808 Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Mon, 5 Jan 2026 15:20:43 -0600 Subject: [PATCH 13/19] get DateFormat when needed to avoid locale setting race conditions --- w_common/lib/time.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/w_common/lib/time.dart b/w_common/lib/time.dart index b25cabaa..d10e6ae0 100644 --- a/w_common/lib/time.dart +++ b/w_common/lib/time.dart @@ -1,20 +1,19 @@ library w_common.timestamp; import 'package:intl/intl.dart'; - -final locale = Intl.getCurrentLocale(); +import 'package:w_common/src/intl/time_intl.dart'; /// The format of a timestamp with no date. -DateFormat timeFormat = DateFormat('h:mma', locale); +DateFormat get timeFormat => DateFormat('h:mma'); /// The format of a weekday with no time of day. -DateFormat weekdayFormat = DateFormat.EEEE(locale); +DateFormat get weekdayFormat => DateFormat.EEEE(); /// The format of a month and day with no time of day. -DateFormat monthDayFormat = DateFormat.MMMMd(locale); +DateFormat get monthDayFormat => DateFormat.MMMMd(); /// The format of the full date with no time of day. -DateFormat yearMonthDayFormat = DateFormat.yMMMd(locale); +DateFormat get yearMonthDayFormat => DateFormat.yMMMd(); /// Formats a DateTime into the 'X ago' string format. String formatTimeDifference(DateTime time, {DateTime? now}) { @@ -24,12 +23,12 @@ String formatTimeDifference(DateTime time, {DateTime? now}) { if (deltaDays < 1 && now.day == time.day) { // "Today, XX:XXam" - return '${Intl.message('Today')}, $timeOfDay'; + return '${TimeIntl.today}, $timeOfDay'; } if (deltaDays < 2 && now.weekday == (time.weekday + 1) % 7) { // "Yesterday, XX:XXam" - return '${Intl.message('Yesterday')}, $timeOfDay'; + return '${TimeIntl.yesterday}, $timeOfDay'; } // Weekday check prevents ambiguity between dates that are From 62b8114f0f34a3c33acdd4e4bdb7ed6332ce52e7 Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Mon, 5 Jan 2026 15:47:13 -0600 Subject: [PATCH 14/19] don't depend on w_intl --- w_common/lib/src/intl/time_intl.dart | 2 +- w_common/pubspec.yaml | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/w_common/lib/src/intl/time_intl.dart b/w_common/lib/src/intl/time_intl.dart index acc11dd7..7182e460 100644 --- a/w_common/lib/src/intl/time_intl.dart +++ b/w_common/lib/src/intl/time_intl.dart @@ -1,4 +1,4 @@ -import 'package:w_intl/intl_wrapper.dart'; +import 'package:intl/intl.dart'; class TimeIntl { static String get today => Intl.message('Today', name: 'TimeIntl_today'); diff --git a/w_common/pubspec.yaml b/w_common/pubspec.yaml index 7eea36fd..27249057 100644 --- a/w_common/pubspec.yaml +++ b/w_common/pubspec.yaml @@ -17,9 +17,3 @@ dev_dependencies: mocktail: ^1.0.4 test: ^1.21.1 workiva_analysis_options: ^1.4.2 - - # hosted dependencies - w_intl: - hosted: - name: w_intl - url: https://pub.workiva.org From bc61969bc90de3a5a0137ac675c3d0c66be92d6b Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Mon, 5 Jan 2026 15:51:27 -0600 Subject: [PATCH 15/19] format --- w_common/lib/src/intl/time_intl.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/w_common/lib/src/intl/time_intl.dart b/w_common/lib/src/intl/time_intl.dart index 7182e460..87caa8e1 100644 --- a/w_common/lib/src/intl/time_intl.dart +++ b/w_common/lib/src/intl/time_intl.dart @@ -3,5 +3,6 @@ import 'package:intl/intl.dart'; class TimeIntl { static String get today => Intl.message('Today', name: 'TimeIntl_today'); - static String get yesterday => Intl.message('Yesterday', name: 'TimeIntl_yesterday'); + static String get yesterday => + Intl.message('Yesterday', name: 'TimeIntl_yesterday'); } From b6a800e3e5cac3a4811dc3601a4f917d0838c220 Mon Sep 17 00:00:00 2001 From: Abe Scheideman Date: Mon, 5 Jan 2026 16:01:41 -0600 Subject: [PATCH 16/19] hour minute skeleton --- w_common/lib/time.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/w_common/lib/time.dart b/w_common/lib/time.dart index d10e6ae0..a78fdc9b 100644 --- a/w_common/lib/time.dart +++ b/w_common/lib/time.dart @@ -4,7 +4,7 @@ import 'package:intl/intl.dart'; import 'package:w_common/src/intl/time_intl.dart'; /// The format of a timestamp with no date. -DateFormat get timeFormat => DateFormat('h:mma'); +DateFormat get timeFormat => DateFormat.jm(); /// The format of a weekday with no time of day. DateFormat get weekdayFormat => DateFormat.EEEE(); From b85897e55328f464663327199c8fd1c24c3aead0 Mon Sep 17 00:00:00 2001 From: Jacob Feddersen Date: Wed, 7 Jan 2026 11:31:21 -0600 Subject: [PATCH 17/19] include puncutation in intl string --- w_common/lib/src/intl/time_intl.dart | 7 ++++--- w_common/lib/time.dart | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/w_common/lib/src/intl/time_intl.dart b/w_common/lib/src/intl/time_intl.dart index 87caa8e1..7f48e78d 100644 --- a/w_common/lib/src/intl/time_intl.dart +++ b/w_common/lib/src/intl/time_intl.dart @@ -1,8 +1,9 @@ import 'package:intl/intl.dart'; class TimeIntl { - static String get today => Intl.message('Today', name: 'TimeIntl_today'); + static String today(String timeOfDay) => + Intl.message('Today, $timeOfDay', args: [timeOfDay], name: 'TimeIntl_today'); - static String get yesterday => - Intl.message('Yesterday', name: 'TimeIntl_yesterday'); + static String yesterday(String timeOfDay) => + Intl.message('Yesterday, $timeOfDay', args: [timeOfDay], name: 'TimeIntl_yesterday'); } diff --git a/w_common/lib/time.dart b/w_common/lib/time.dart index a78fdc9b..d6e4b093 100644 --- a/w_common/lib/time.dart +++ b/w_common/lib/time.dart @@ -23,12 +23,12 @@ String formatTimeDifference(DateTime time, {DateTime? now}) { if (deltaDays < 1 && now.day == time.day) { // "Today, XX:XXam" - return '${TimeIntl.today}, $timeOfDay'; + return TimeIntl.today(timeOfDay); } if (deltaDays < 2 && now.weekday == (time.weekday + 1) % 7) { // "Yesterday, XX:XXam" - return '${TimeIntl.yesterday}, $timeOfDay'; + return TimeIntl.yesterday(timeOfDay); } // Weekday check prevents ambiguity between dates that are From e0483f1ce52e4714a31411d6d04e28e483cb74cc Mon Sep 17 00:00:00 2001 From: Jacob Feddersen Date: Wed, 7 Jan 2026 11:32:29 -0600 Subject: [PATCH 18/19] dartfmt --- w_common/lib/src/intl/time_intl.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/w_common/lib/src/intl/time_intl.dart b/w_common/lib/src/intl/time_intl.dart index 7f48e78d..06c36764 100644 --- a/w_common/lib/src/intl/time_intl.dart +++ b/w_common/lib/src/intl/time_intl.dart @@ -1,9 +1,10 @@ import 'package:intl/intl.dart'; class TimeIntl { - static String today(String timeOfDay) => - Intl.message('Today, $timeOfDay', args: [timeOfDay], name: 'TimeIntl_today'); + static String today(String timeOfDay) => Intl.message('Today, $timeOfDay', + args: [timeOfDay], name: 'TimeIntl_today'); static String yesterday(String timeOfDay) => - Intl.message('Yesterday, $timeOfDay', args: [timeOfDay], name: 'TimeIntl_yesterday'); + Intl.message('Yesterday, $timeOfDay', + args: [timeOfDay], name: 'TimeIntl_yesterday'); } From 2e748f4068b86ee0100b306ecde1d56e3f460147 Mon Sep 17 00:00:00 2001 From: Jacob Feddersen Date: Wed, 7 Jan 2026 12:13:18 -0600 Subject: [PATCH 19/19] remove toLowerCase, as it may not work correctly in all locales --- w_common/lib/time.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/w_common/lib/time.dart b/w_common/lib/time.dart index d6e4b093..a320b09b 100644 --- a/w_common/lib/time.dart +++ b/w_common/lib/time.dart @@ -18,7 +18,7 @@ DateFormat get yearMonthDayFormat => DateFormat.yMMMd(); /// Formats a DateTime into the 'X ago' string format. String formatTimeDifference(DateTime time, {DateTime? now}) { now ??= DateTime.now(); - final timeOfDay = timeFormat.format(time).toLowerCase(); + final timeOfDay = timeFormat.format(time); final deltaDays = now.difference(time).inDays.abs(); if (deltaDays < 1 && now.day == time.day) {