community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1698152 - /comdev/reporter.apache.org/trunk/site/render.js
Date Thu, 27 Aug 2015 13:39:37 GMT
Author: sebb
Date: Thu Aug 27 13:39:36 2015
New Revision: 1698152

URL: http://svn.apache.org/r1698152
Log:
Match every month

Modified:
    comdev/reporter.apache.org/trunk/site/render.js

Modified: comdev/reporter.apache.org/trunk/site/render.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/render.js?rev=1698152&r1=1698151&r2=1698152&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/render.js (original)
+++ comdev/reporter.apache.org/trunk/site/render.js Thu Aug 27 13:39:36 2015
@@ -65,12 +65,12 @@ function getWednesdays(mo, y) {
 
 	d.setDate(1);
 
-	// Get the first Monday in the month
+	// Get the first Wednesday (day 3 of week) in the month
 	while (d.getDay() !== 3) {
 		d.setDate(d.getDate() + 1);
 	}
 
-	// Get all the other Mondays in the month
+	// Get all the other Wednesdays in the month
 	while (d.getMonth() === month) {
 		wednesdays.push(new Date(d.getTime()));
 		d.setDate(d.getDate() + 7);
@@ -85,32 +85,30 @@ function setReportDate(json, x) {
 	var reportdate = x[1]
 	var fullname = (x[2] ? x[2] : "Unknown").replace(/Apache /, "")
 	var m = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December']
+	var em = 'Every month'
 	var today = new Date()
 
-	var dates = []
+	var dates = [] // the entries must be in date order
 	if (!json[pmc]) {
 		pmc = fullname
 	}
 	for (i in json[pmc]) {
-		tm = 0;
 		sm = json[pmc][i]
 		for (x in m) {
-			if (m[x] == sm) {
-				tm = x;
+			if (m[x] == sm || sm == em) {
+				dates.push(getWednesdays(x)[2])
 			}
 		}
-		dates.push(getWednesdays(tm)[2])
 	}
+	// cannot combine with the code above because that would destroy the order
 	var ny = today.getFullYear() + 1;
 	for (i in json[pmc]) {
-		tm = 0;
 		sm = json[pmc][i]
 		for (x in m) {
-			if (m[x] == sm) {
-				tm = x;
+			if (m[x] == sm || sm == em) {
+				dates.push(getWednesdays(x)[2])
 			}
 		}
-		dates.push(getWednesdays(tm)[2], ny)
 	}
 	var nextdate = dates[0];
 	while (nextdate < today) {
@@ -118,7 +116,8 @@ function setReportDate(json, x) {
 	}
 	reportdate.innerHTML += "<b>Next report date: " + (nextdate ? nextdate.toDateString()
: "Unknown(?)") + "</b>"
 	if (nextdate) {
-		var link = "https://svn.apache.org/repos/private/foundation/board/board_agenda_" +  nextdate.getFullYear()
+ "_" + (nextdate.getMonth() < 9 ? "0" : "") + (nextdate.getMonth() +1) + "_" + nextdate.getDate()
+ ".txt"
+		var link = "https://svn.apache.org/repos/private/foundation/board/board_agenda_" +  nextdate.getFullYear()
+
+					"_" + (nextdate.getMonth() < 9 ? "0" : "") + (nextdate.getMonth() +1) + "_" + nextdate.getDate()
+ ".txt"
 		reportdate.innerHTML += "<br>File your report in <a href='"+link+"'>"+link+"</a>
when it has been seeded."
 	}
 	



Mime
View raw message