How far in the future should we show?

The greatest function immediately stores the greatest one-time calendar entry's date that exists in the list, and is then modified to represent the last day that will be represented, which is a year after the greatest one-time calendar entry found (if there are recurring calendar entries, there will probably be a number of instances rendered after the last one-time calendar entry):

 var greatest = this.new_entry(); for(var index = 0; index < this.state.entries.length; ++index) { var entry = this.state.entries[index]; if (!entry.hasOwnProperty('repeats') && entry.repeats) { if (compare(entry, greatest) === 1) { greatest = this.new_entry(); greatest.year = entry.year; greatest.month = entry.month; greatest.date ...

Get React: Building Modern Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.