From a20e87bc165e6f49ce1b3bce1223032e7e88762d Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Sat, 1 Jun 2013 10:20:13 -0700 Subject: [PATCH] Conpherence - fix off by one bug in calendar data fetching Summary: Ref T3155. "last sunday" is "last sunday at 00:00" so you have to include a day for Sunday itself. Test Plan: calendar renders correctly today - saturday - which is the edge case of this Reviewers: epriestley, chad Reviewed By: chad CC: aran, Korvin Maniphest Tasks: T3155 Differential Revision: https://secure.phabricator.com/D6108 --- .../conpherence/controller/ConpherenceWidgetController.php | 2 +- src/applications/conpherence/query/ConpherenceThreadQuery.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/conpherence/controller/ConpherenceWidgetController.php b/src/applications/conpherence/controller/ConpherenceWidgetController.php index 86ef133029..bd83d3cd29 100644 --- a/src/applications/conpherence/controller/ConpherenceWidgetController.php +++ b/src/applications/conpherence/controller/ConpherenceWidgetController.php @@ -385,7 +385,7 @@ final class ConpherenceWidgetController extends $first_day = new DateTime('last sunday', $timezone); $timestamps = array(); - for ($day = 0; $day < 8; $day++) { + for ($day = 0; $day < 9; $day++) { $timestamp = clone $first_day; $timestamps[] = $timestamp->modify(sprintf('+%d days', $day)); } diff --git a/src/applications/conpherence/query/ConpherenceThreadQuery.php b/src/applications/conpherence/query/ConpherenceThreadQuery.php index 33b6f84260..5b20dbd89e 100644 --- a/src/applications/conpherence/query/ConpherenceThreadQuery.php +++ b/src/applications/conpherence/query/ConpherenceThreadQuery.php @@ -225,7 +225,7 @@ final class ConpherenceThreadQuery $this->getViewer(), 'U'); $end_epoch = phabricator_format_local_time( - strtotime('last sunday +8 days', strtotime('tomorrow')), + strtotime('last sunday +9 days', strtotime('tomorrow')), $this->getViewer(), 'U'); $statuses = id(new PhabricatorUserStatus())