From cb4ad529f465dcdb0e7efedc5ac4c06c63b8b194 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sat, 18 Jan 2020 20:54:46 +0100 Subject: [PATCH] Move L10n::getDay() calls to DI::l10n()->getDay() calls --- src/Content/Widget.php | 2 +- src/Model/Event.php | 10 +++++----- src/Model/Profile.php | 6 +++--- src/Util/Temporal.php | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Content/Widget.php b/src/Content/Widget.php index 496bbfcb68..2052d216d2 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -476,7 +476,7 @@ class Widget $dend = substr($dnow, 0, 8) . Temporal::getDaysInMonth(intval($dnow), intval(substr($dnow, 5))); $start_month = DateTimeFormat::utc($dstart, 'Y-m-d'); $end_month = DateTimeFormat::utc($dend, 'Y-m-d'); - $str = L10n::getDay(DateTimeFormat::utc($dnow, 'F')); + $str = DI::l10n()->getDay(DateTimeFormat::utc($dnow, 'F')); if (empty($ret[$dyear])) { $ret[$dyear] = []; diff --git a/src/Model/Event.php b/src/Model/Event.php index 6f309a3397..e5932e7c1d 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -33,13 +33,13 @@ class Event $bd_format = DI::l10n()->t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8 AM. - $event_start = L10n::getDay( + $event_start = DI::l10n()->getDay( !empty($event['adjust']) ? DateTimeFormat::local($event['start'], $bd_format) : DateTimeFormat::utc($event['start'], $bd_format) ); if (!empty($event['finish'])) { - $event_end = L10n::getDay( + $event_end = DI::l10n()->getDay( !empty($event['adjust']) ? DateTimeFormat::local($event['finish'], $bd_format) : DateTimeFormat::utc($event['finish'], $bd_format) ); @@ -571,7 +571,7 @@ class Event $start = $event['adjust'] ? DateTimeFormat::local($event['start'], 'c') : DateTimeFormat::utc($event['start'], 'c'); $j = $event['adjust'] ? DateTimeFormat::local($event['start'], 'j') : DateTimeFormat::utc($event['start'], 'j'); $day = $event['adjust'] ? DateTimeFormat::local($event['start'], $fmt) : DateTimeFormat::utc($event['start'], $fmt); - $day = L10n::getDay($day); + $day = DI::l10n()->getDay($day); if ($event['nofinish']) { $end = null; @@ -849,7 +849,7 @@ class Event $tformat = DI::l10n()->t('g:i A'); // 8:01 AM. // Convert the time to different formats. - $dtstart_dt = L10n::getDay( + $dtstart_dt = DI::l10n()->getDay( $item['event-adjust'] ? DateTimeFormat::local($item['event-start'], $dformat) : DateTimeFormat::utc($item['event-start'], $dformat) @@ -877,7 +877,7 @@ class Event // If the option 'nofinisch' isn't set, we need to format the finish date/time. if (!$item['event-nofinish']) { $finish = true; - $dtend_dt = L10n::getDay( + $dtend_dt = DI::l10n()->getDay( $item['event-adjust'] ? DateTimeFormat::local($item['event-finish'], $dformat) : DateTimeFormat::utc($item['event-finish'], $dformat) diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 6699c82872..bb19fbe9b7 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -640,7 +640,7 @@ class Profile $rr['link'] = Contact::magicLink($rr['url']); $rr['title'] = $rr['name']; - $rr['date'] = L10n::getDay(DateTimeFormat::convert($rr['start'], $a->timezone, 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . DI::l10n()->t('[today]') : ''); + $rr['date'] = DI::l10n()->getDay(DateTimeFormat::convert($rr['start'], $a->timezone, 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . DI::l10n()->t('[today]') : ''); $rr['startime'] = null; $rr['today'] = $today; } @@ -725,7 +725,7 @@ class Profile $rr['title'] = $title; $rr['description'] = $description; - $rr['date'] = L10n::getDay(DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC', 'UTC', $bd_format)) . (($today) ? ' ' . DI::l10n()->t('[today]') : ''); + $rr['date'] = DI::l10n()->getDay(DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC', 'UTC', $bd_format)) . (($today) ? ' ' . DI::l10n()->t('[today]') : ''); $rr['startime'] = $strt; $rr['today'] = $today; @@ -767,7 +767,7 @@ class Profile $year_bd_format = DI::l10n()->t('j F, Y'); $short_bd_format = DI::l10n()->t('j F'); - $val = L10n::getDay( + $val = DI::l10n()->getDay( intval($a->profile['dob']) ? DateTimeFormat::utc($a->profile['dob'] . ' 00:00 +00:00', $year_bd_format) : DateTimeFormat::utc('2001-' . substr($a->profile['dob'], 5) . ' 00:00 +00:00', $short_bd_format) diff --git a/src/Util/Temporal.php b/src/Util/Temporal.php index 75211a0927..4bc2b03d1b 100644 --- a/src/Util/Temporal.php +++ b/src/Util/Temporal.php @@ -466,11 +466,11 @@ class Temporal $tddate = intval(DateTimeFormat::localNow('j')); } - $str_month = L10n::getDay($mtab[$m]); + $str_month = DI::l10n()->getDay($mtab[$m]); $o = ''; $o .= ""; for ($a = 0; $a < 7; $a ++) { - $o .= ''; + $o .= ''; } $o .= ''; -- 2.39.5
$str_month $y
' . mb_substr(L10n::getDay($dn[$a]), 0, 3, 'UTF-8') . '' . mb_substr(DI::l10n()->getDay($dn[$a]), 0, 3, 'UTF-8') . '