Page MenuHomePhabricator

Calendar day view should start at 8am at the latest and hour of first event at the earliest.
ClosedPublic

Authored by lpriestley on May 8 2015, 10:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 15, 4:45 AM
Unknown Object (File)
Fri, Mar 15, 4:45 AM
Unknown Object (File)
Sun, Mar 10, 3:58 AM
Unknown Object (File)
Feb 9 2024, 12:10 AM
Unknown Object (File)
Dec 27 2023, 6:14 AM
Unknown Object (File)
Dec 27 2023, 6:14 AM
Unknown Object (File)
Dec 27 2023, 6:14 AM
Unknown Object (File)
Dec 21 2023, 1:14 PM
Subscribers

Details

Summary

Closes T8114, Calendar day view should start at 8am at the latest and hour of first event at the earliest.

Test Plan

Open day view on day with all day event and event at 5am, all day events should all be stacked at the top of the day view table, and day should start at 5am.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lpriestley retitled this revision from to Calendar day view should start at 8am at the latest and hour of first event at the earliest..
lpriestley updated this object.
lpriestley edited the test plan for this revision. (Show Details)
lpriestley added a reviewer: epriestley.
epriestley edited edge metadata.

I think I caught one actual problem (views with no events at all) -- either fix that or let me know it works fine?

src/view/phui/calendar/PHUICalendarDayView.php
111–112

Maybe this would be more clear as something like:

$first_visible_hour = min($first_event_hour->format('G'), 8);
if ($hour->format('G') < $first_visible_hour) {
  continue;
}

Best I can come up with.

Actually, I'd guess this might cause a problem on days with no events ("Trying to call method format() on null."). So maybe it's like:

$first_visible_hour = 8;
if ($first_event_hour) {
  $first_event_hour_number = $first_event_hour->format('G');
  if ($first_event_hour_number < $first_visible_hour) {
    $first_visible_hour = $first_event_hour_number;
  }
}
if ($hour->format('G') < $first_visible_hour) {
  continue;
}

That could be a little cleaner, maybe, as:

$early_hours = array(8);
if ($first_event_hour) {
  $early_hours[] = $first_event_hour->format('G');
}
if (hour->format('G') < min($early_hours)) {
  continue;
}
165

For days with no all day events, does this render something anything funky?

webroot/rsrc/css/phui/calendar/phui-calendar-day.css
10–12

Unused

This revision now requires changes to proceed.May 8 2015, 11:07 PM
src/view/phui/calendar/PHUICalendarDayView.php
165

Nope. Looks okay with no events.

lpriestley edited edge metadata.

Fix for days with no events

epriestley edited edge metadata.
This revision is now accepted and ready to land.May 8 2015, 11:19 PM
This revision was automatically updated to reflect the committed changes.