React: Building Modern Web Applications
by Jonathan Hayward, Artemij Fedosejev, Narayan Prusty, Adam Horton, Ryan Vice, Ethan Holmes, Tom Bray
Now we're ready to display!
Here is the for loop mentioned earlier; it is considerably more readable with compare() and successor() pulled into their own variables with descriptive names rather than inline. For each day, the loop compiles a (possibly empty) list starting with one-time activities for that day, and checks all recurring calendar entries against it. For a recurring calendar entry, it starts out with accepts_this_date as true, indicating that the calendar entry does occur on that day, and then each of the criteria for a repeating date has a cumulative opportunity to say that the criterion they are checking is not met and veto that calendar entry happening on that day. If a recurring calendar entry passes through the gauntlet without ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access