Different stripes for different entry types

Calendar entries are segregated into one-time and repeating entries, so only a probable minority of repeating calendar entries are checked for every day. One-time calendar entries are put into a hash with a key straightforwardly taken from their date:

 var once = {}; var repeating = []; for(var index = 0; index < this.state.entries.length; ++index) { var entry = this.state.entries[index]; if (entry.hasOwnProperty('repeats') && entry.repeats) { repeating.push(entry); } else { var key = (entry.date + '/' + entry.month + '/' + entry.year); if (once.hasOwnProperty(key)) { once[key].push(entry); } else { once[key] = [entry]; } } } greatest.year += 1; var first_day = this.new_entry(); first_day.days_ahead = ...

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.