Add Temporal::timezoneNow() shorthand for Temporal::convert()
This commit is contained in:
parent
35d06bd9eb
commit
89602e44da
8 changed files with 31 additions and 20 deletions
|
@ -152,8 +152,8 @@ function cal_content(App $a)
|
|||
|
||||
// The view mode part is similiar to /mod/events.php
|
||||
if ($mode == 'view') {
|
||||
$thisyear = Temporal::convert('now', date_default_timezone_get(), 'UTC', 'Y');
|
||||
$thismonth = Temporal::convert('now', date_default_timezone_get(), 'UTC', 'm');
|
||||
$thisyear = Temporal::timezoneNow(date_default_timezone_get(), 'Y');
|
||||
$thismonth = Temporal::timezoneNow(date_default_timezone_get(), 'm');
|
||||
if (!$y) {
|
||||
$y = intval($thisyear);
|
||||
}
|
||||
|
|
|
@ -276,8 +276,8 @@ function events_content(App $a) {
|
|||
// The view mode part is similiar to /mod/cal.php
|
||||
if ($mode == 'view') {
|
||||
|
||||
$thisyear = Temporal::convert('now', date_default_timezone_get(), 'UTC', 'Y');
|
||||
$thismonth = Temporal::convert('now', date_default_timezone_get(), 'UTC', 'm');
|
||||
$thisyear = Temporal::timezoneNow(date_default_timezone_get(), 'Y');
|
||||
$thismonth = Temporal::timezoneNow(date_default_timezone_get(), 'm');
|
||||
if (! $y) {
|
||||
$y = intval($thisyear);
|
||||
}
|
||||
|
|
|
@ -402,7 +402,7 @@ function photos_post(App $a)
|
|||
$resource_id = $a->argv[2];
|
||||
|
||||
if (!strlen($albname)) {
|
||||
$albname = Temporal::convert('now', date_default_timezone_get(), 'UTC', 'Y');
|
||||
$albname = Temporal::timezoneNow(date_default_timezone_get(), 'Y');
|
||||
}
|
||||
|
||||
if (x($_POST,'rotate') !== false &&
|
||||
|
@ -738,7 +738,7 @@ function photos_post(App $a)
|
|||
if (strlen($newalbum)) {
|
||||
$album = $newalbum;
|
||||
} else {
|
||||
$album = Temporal::convert('now', date_default_timezone_get(), 'UTC', 'Y');
|
||||
$album = Temporal::timezoneNow(date_default_timezone_get(), 'Y');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ function ping_init(App $a)
|
|||
$all_events = count($ev);
|
||||
|
||||
if ($all_events) {
|
||||
$str_now = Temporal::convert('now', $a->timezone, 'UTC', 'Y-m-d');
|
||||
$str_now = Temporal::timezoneNow($a->timezone, 'Y-m-d');
|
||||
foreach ($ev as $x) {
|
||||
$bd = false;
|
||||
if ($x['type'] === 'birthday') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue