1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Fix a bug on Calendar event day views for all day events in certain timezones

Summary:
Ref T11816. This logic was correct, we just did all the work and then mostly threw away the results. This worked correctly anyway in some timezones.

Instead, actually use `$min_date` and `$max_date`.

Test Plan: In "America/Toronto" with server in a more-western timezone, viewed a "Nov 11 - Nov 12" all-day event, saw those dates.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11816

Differential Revision: https://secure.phabricator.com/D16867
This commit is contained in:
epriestley 2016-11-15 10:17:28 -08:00
parent f91269a4a8
commit 6464934cd6

View file

@ -590,10 +590,10 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
$start = $this->newStartDateTime();
$end = $this->newEndDateTime();
if ($show_end) {
$min_date = $start->newPHPDateTime();
$max_date = $end->newPHPDateTime();
if ($show_end) {
// Subtract one second since the stored date is exclusive.
$max_date = $max_date->modify('-1 second');
@ -605,8 +605,8 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
$show_end_date = false;
}
$min_epoch = $start->getEpoch();
$max_epoch = $end->getEpoch();
$min_epoch = $min_date->format('U');
$max_epoch = $max_date->format('U');
if ($this->getIsAllDay()) {
if ($show_end_date) {