$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') {
} 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 ++;
public $argv;
/** @deprecated 2019.09 - use App\Arguments->getArgc() */
public $argc;
- public $timezone;
public $theme_info = [];
// Allow themes to control internal parameters
// by changing App values in theme.php
public $theme_events_in_profile = true;
public $queue;
+ private $timezone = '';
private $profile_owner = 0;
private $contact_id = 0;
return $this->contact_id;
}
+ /**
+ * Set the timezone
+ *
+ * @param int $timezone
+ * @return void
+ */
+ public function setTimeZone(string $timezone)
+ {
+ $this->timezone = $timezone;
+ }
+
+ /**
+ * Get the timezone
+ *
+ * @return int
+ */
+ public function getTimeZone():string
+ {
+ return $this->timezone;
+ }
+
/**
* Returns the current config cache of this node
*
$rr['link'] = Contact::magicLinkById($rr['cid']);
$rr['title'] = $rr['name'];
- $rr['date'] = DI::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->getTimeZone(), 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
$rr['startime'] = null;
$rr['today'] = $today;
}
$total++;
}
- $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC', 'UTC', 'Y-m-d');
- if ($strt === DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d')) {
+ $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->getTimeZone() : 'UTC', 'UTC', 'Y-m-d');
+ if ($strt === DateTimeFormat::timezoneNow($a->getTimeZone(), 'Y-m-d')) {
$istoday = true;
}
$description = DI::l10n()->t('[No description]');
}
- $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC');
+ $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->getTimeZone() : 'UTC');
- if (substr($strt, 0, 10) < DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d')) {
+ if (substr($strt, 0, 10) < DateTimeFormat::timezoneNow($a->getTimeZone(), 'Y-m-d')) {
continue;
}
- $today = ((substr($strt, 0, 10) === DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d')) ? true : false);
+ $today = ((substr($strt, 0, 10) === DateTimeFormat::timezoneNow($a->getTimeZone(), 'Y-m-d')) ? true : false);
$rr['title'] = $title;
$rr['description'] = $description;
- $rr['date'] = DI::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->getTimeZone() : 'UTC', 'UTC', $bd_format)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
$rr['startime'] = $strt;
$rr['today'] = $today;