June 2016
Intermediate to advanced
910 pages
18h 59m
English
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 = ...Read now
Unlock full access