Page MenuHomePhabricator

Fix calendar part 2
ClosedPublic

Authored by btrahan on Feb 25 2014, 9:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 11:56 AM
Unknown Object (File)
Fri, Dec 20, 6:22 AM
Unknown Object (File)
Tue, Dec 17, 10:46 AM
Unknown Object (File)
Tue, Dec 17, 9:58 AM
Unknown Object (File)
Tue, Dec 17, 3:38 AM
Unknown Object (File)
Sun, Dec 15, 10:02 PM
Unknown Object (File)
Fri, Nov 29, 1:57 AM
Unknown Object (File)
Fri, Nov 29, 1:57 AM

Details

Reviewers
epriestley
chad
Commits
Restricted Diffusion Commit
rP9b0f906207eb: Fix calendar part 2
Summary

D8341 was a good start. However, I was looping through all the statuses each time, when I should only deal with a given status once. Instead, unset() a status from the list of statuses once we handled it. Also, delete the last old $key thing, which interfered with my chosen strategy.

Test Plan

made a two day event and verified it showed up in just those two days. (will push and test again just in case but this should be it)

Diff Detail

Repository
rP Phabricator
Branch
fixcal2
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

{F118245}

It was a classy test status

epriestley added inline comments.
src/applications/people/controller/PhabricatorPeopleProfileController.php
185–186

Could we remove this loop part instead? It looks like the logic is:

foreach (day) {
  foreach (event) {
    foreach (future day) {
      put the event on all of the days it goes on
    }
    unset the event;
  }
}

Instead, maybe one of these would be simpler?

foreach (day) {
  foreach (event) {
    maybe put this event on this day
  }
}

Or:

foreach (event) {
  put it on all the days it goes on
}
btrahan updated this revision to Unknown Object (????).Feb 25 2014, 10:17 PM

use foreach (epoch / day) { foreach (event) } algorithm.

(i don't think I can just do foreach (event) as it is about mapping these events to days.)

tested by adding a bunch more events to myself; it works