Remove event.adjust field

- It was confusing and introduced complexity that wasn't worth the unclear gain
This commit is contained in:
Hypolite Petovan 2021-10-03 13:21:17 -04:00
parent 6db211568a
commit 9935e8e711
24 changed files with 66 additions and 195 deletions

View file

@ -555,7 +555,7 @@ class Profile
$rr['link'] = Contact::magicLinkById($rr['cid']);
$rr['title'] = $rr['name'];
$rr['date'] = DI::l10n()->getDay(DateTimeFormat::convert($rr['start'], $a->getTimeZone(), 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
$rr['date'] = DI::l10n()->getDay(DateTimeFormat::local($rr['start'], $bd_short)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
$rr['startime'] = null;
$rr['today'] = $today;
}
@ -614,8 +614,8 @@ class Profile
$total++;
}
$strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->getTimeZone() : 'UTC', 'UTC', 'Y-m-d');
if ($strt === DateTimeFormat::timezoneNow($a->getTimeZone(), 'Y-m-d')) {
$strt = DateTimeFormat::local($rr['start'], 'Y-m-d');
if ($strt === DateTimeFormat::localNow('Y-m-d')) {
$istoday = true;
}
@ -630,17 +630,17 @@ class Profile
$description = DI::l10n()->t('[No description]');
}
$strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->getTimeZone() : 'UTC');
$strt = DateTimeFormat::local($rr['start']);
if (substr($strt, 0, 10) < DateTimeFormat::timezoneNow($a->getTimeZone(), 'Y-m-d')) {
if (substr($strt, 0, 10) < DateTimeFormat::localNow('Y-m-d')) {
continue;
}
$today = ((substr($strt, 0, 10) === DateTimeFormat::timezoneNow($a->getTimeZone(), 'Y-m-d')) ? true : false);
$today = substr($strt, 0, 10) === DateTimeFormat::localNow('Y-m-d');
$rr['title'] = $title;
$rr['description'] = $description;
$rr['date'] = DI::l10n()->getDay(DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->getTimeZone() : 'UTC', 'UTC', $bd_format)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
$rr['date'] = DI::l10n()->getDay(DateTimeFormat::local($rr['start'], $bd_format)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
$rr['startime'] = $strt;
$rr['today'] = $today;