From 7f6474b269a5cfa454d28c0c0da969490c9eb33e Mon Sep 17 00:00:00 2001 From: Jared Deckard Date: Tue, 26 Jul 2016 22:32:10 -0500 Subject: Restore comments lost when converting CoffeeScript to JavaScript --- app/assets/javascripts/users/calendar.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/assets/javascripts/users/calendar.js') diff --git a/app/assets/javascripts/users/calendar.js b/app/assets/javascripts/users/calendar.js index 90cf551b32e..b8da7c4f297 100644 --- a/app/assets/javascripts/users/calendar.js +++ b/app/assets/javascripts/users/calendar.js @@ -11,6 +11,8 @@ this.daySizeWithSpace = this.daySize + (this.daySpace * 2); this.monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; this.months = []; + // Loop through the timestamps to create a group of objects + // The group of objects will be grouped based on the day of the week they are this.timestampsTmp = []; var group = 0; @@ -29,12 +31,15 @@ var day = date.getDay(); var count = timestamps[date.getTime() * 0.001]; + // Create a new group array if this is the first day of the week + // or if is first object if ((day === 0 && i !== 0) || i === 0) { this.timestampsTmp.push([]); group++; } var innerArray = this.timestampsTmp[group - 1]; + // Push to the inner array the values that will be used to render map innerArray.push({ count: count || 0, date: date, @@ -42,8 +47,10 @@ }); } + // Init color functions this.colorKey = this.initColorKey(); this.color = this.initColor(); + // Init the svg element this.renderSvg(group); this.renderDays(); this.renderMonths(); -- cgit v1.2.1