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

This commit is contained in:
Hypolite Petovan 2018-01-26 19:16:22 -05:00
commit a2ee2b56d2
5 changed files with 23 additions and 12 deletions

View file

@ -152,8 +152,8 @@ function cal_content(App $a)
// The view mode part is similiar to /mod/events.php
if ($mode == 'view') {
$thisyear = Temporal::timezoneNow(date_default_timezone_get(), 'Y');
$thismonth = Temporal::timezoneNow(date_default_timezone_get(), 'm');
$thisyear = Temporal::localNow('Y');
$thismonth = Temporal::localNow('m');
if (!$y) {
$y = intval($thisyear);
}

View file

@ -276,8 +276,8 @@ function events_content(App $a) {
// The view mode part is similiar to /mod/cal.php
if ($mode == 'view') {
$thisyear = Temporal::timezoneNow(date_default_timezone_get(), 'Y');
$thismonth = Temporal::timezoneNow(date_default_timezone_get(), 'm');
$thisyear = Temporal::localNow('Y');
$thismonth = Temporal::localNow('m');
if (! $y) {
$y = intval($thisyear);
}

View file

@ -402,7 +402,7 @@ function photos_post(App $a)
$resource_id = $a->argv[2];
if (!strlen($albname)) {
$albname = Temporal::timezoneNow(date_default_timezone_get(), 'Y');
$albname = Temporal::localNow('Y');
}
if (x($_POST,'rotate') !== false &&
@ -738,7 +738,7 @@ function photos_post(App $a)
if (strlen($newalbum)) {
$album = $newalbum;
} else {
$album = Temporal::timezoneNow(date_default_timezone_get(), 'Y');
$album = Temporal::localNow('Y');
}
}