Add Temporal::timezoneNow() shorthand for Temporal::convert()

This commit is contained in:
Hypolite Petovan 2018-01-26 19:14:15 -05:00
parent 35d06bd9eb
commit 89602e44da
8 changed files with 31 additions and 20 deletions

View file

@ -659,7 +659,7 @@ class Profile
}
$strt = Temporal::convert($rr['start'], $rr['convert'] ? $a->timezone : 'UTC', 'UTC', 'Y-m-d');
if ($strt === Temporal::convert('now', $a->timezone, 'UTC', 'Y-m-d')) {
if ($strt === Temporal::timezoneNow($a->timezone, 'Y-m-d')) {
$istoday = true;
}
@ -676,11 +676,11 @@ class Profile
$strt = Temporal::convert($rr['start'], $rr['convert'] ? $a->timezone : 'UTC');
if (substr($strt, 0, 10) < Temporal::convert('now', $a->timezone, 'UTC', 'Y-m-d')) {
if (substr($strt, 0, 10) < Temporal::timezoneNow($a->timezone, 'Y-m-d')) {
continue;
}
$today = ((substr($strt, 0, 10) === Temporal::convert('now', $a->timezone, 'UTC', 'Y-m-d')) ? true : false);
$today = ((substr($strt, 0, 10) === Temporal::timezoneNow($a->timezone, 'Y-m-d')) ? true : false);
$rr['title'] = $title;
$rr['description'] = $description;