React: Building Modern Web Applications
by Jonathan Hayward, Artemij Fedosejev, Narayan Prusty, Adam Horton, Ryan Vice, Ethan Holmes, Tom Bray
Avoiding being clever
Let's see a subtlety (which is less obvious when scrolling through the code than looking at the user interface): there are two separate dropdown menus with their own populating arrays representing the month. The reason for this is that in one case, there is supposed to be a choice, not only between specific months, but also between specifying one month only and all months. That menu includes an option of [-1, "Every Month"].
The other example is for the (optionally specified) end date for a series of calendar entries. This is a use case where it does not really make sense to specify that something ends every month. The intended use is to give the day, month, and year on which something stops displaying. The combination of ...
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