Use getter/setter for timezone value

This commit is contained in:
Michael 2021-07-24 21:16:53 +00:00
parent 40a42ccdb1
commit 866dbf9f89
4 changed files with 32 additions and 11 deletions

View file

@ -230,7 +230,7 @@ function ping_init(App $a)
$all_events = count($ev);
if ($all_events) {
$str_now = DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d');
$str_now = DateTimeFormat::timezoneNow($a->getTimeZone(), 'Y-m-d');
foreach ($ev as $x) {
$bd = false;
if ($x['type'] === 'birthday') {
@ -239,7 +239,7 @@ function ping_init(App $a)
} else {
$events ++;
}
if (DateTimeFormat::convert($x['start'], ((intval($x['adjust'])) ? $a->timezone : 'UTC'), 'UTC', 'Y-m-d') === $str_now) {
if (DateTimeFormat::convert($x['start'], ((intval($x['adjust'])) ? $a->getTimeZone() : 'UTC'), 'UTC', 'Y-m-d') === $str_now) {
$all_events_today ++;
if ($bd) {
$birthdays_today ++;