From 66125a9d5f3cdc4b9b401a63905038551245afd5 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Mon, 18 May 2026 15:39:36 +0200 Subject: [PATCH] refactor(strftime): Migrate to native usage of IntlDateFormatter and DateTime Notes (view, list) --- lib/View/List.php | 2 +- view.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/View/List.php b/lib/View/List.php index a471756..5c48b92 100644 --- a/lib/View/List.php +++ b/lib/View/List.php @@ -214,7 +214,7 @@ public function render(Horde_PageOutput $output) } if ($modified) { $memo['modifiedStamp'] = $modified->timestamp(); - $memo['modifiedString'] = $modified->strftime($prefs->getValue('date_format')); + $memo['modifiedString'] = $modified->format($prefs->getValue('date_format'), new \Horde\Date\Formatter\IcuFormatter(), $GLOBALS['language'] ?? 'en_US'); } else { $memo['modifiedStamp'] = $memo['modifiedString'] = ''; } diff --git a/view.php b/view.php index 11df709..fdd6089 100644 --- a/view.php +++ b/view.php @@ -138,19 +138,19 @@ ]); } if (isset($memo['created'])) { - $view->created = $memo['created']->strftime( - $prefs->getValue('date_format') + $view->created = $memo['created']->format( + $prefs->getValue('date_format'), new \Horde\Date\Formatter\IcuFormatter(), $GLOBALS['language'] ?? 'en_US' ) . ' ' . $memo['created']->format( - $prefs->getValue('twentyFour') ? 'G:i' : 'g:i a' + $prefs->getValue('twentyFour') ? 'HH:mm' : 'h:mm a', new \Horde\Date\Formatter\IcuFormatter(), $GLOBALS['language'] ?? 'en_US' ); } if (isset($memo['modified'])) { - $view->modified = $memo['modified']->strftime( - $prefs->getValue('date_format') + $view->modified = $memo['modified']->format( + $prefs->getValue('date_format'), new \Horde\Date\Formatter\IcuFormatter(), $GLOBALS['language'] ?? 'en_US' ) . ' ' . $memo['modified']->format( - $prefs->getValue('twentyFour') ? 'G:i' : 'g:i a' + $prefs->getValue('twentyFour') ? 'HH:mm' : 'h:mm a', new \Horde\Date\Formatter\IcuFormatter(), $GLOBALS['language'] ?? 'en_US' ); }