community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1877614 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/reportdate.js wizard.js
Date Tue, 12 May 2020 01:11:58 GMT
Author: humbedooh
Date: Tue May 12 01:11:57 2020
New Revision: 1877614

URL: http://svn.apache.org/viewvc?rev=1877614&view=rev
Log:
Display the 'report is due' warning at an earlier point in time.

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js?rev=1877614&r1=1877613&r2=1877614&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js Tue May 12 01:11:57
2020
@@ -97,8 +97,12 @@ function getReportDate(json, pmc, dateOn
 			let xdate = new Date(+nextdate); // copy so as to not decrement multiple times
 			xdate.setDate(xdate.getDate() - 7); // Due one week prior to meeting.
 			let rightnow = new Date();
-			if (xdate <= rightnow) {
+			 // If less than 7 days till due date (14 days prior to meeting), light up the christmas
trees
+			if (xdate.diff(rightnow, 'days') < 14) {
 				if (pdata && pdata.filed[pmc] == true) return new HTML('span', {style: { color:
'#396'}}, xdate.toDateString() + " (Report filed)");
+				if (xdate.diff(rightnow, 'days') > 0) {
+					return new HTML('span', {style: { color: '#711'}}, xdate.toDateString() + " (Report
is due in %s)".format(moment(xdate).fromNow()));
+				}
 				return new HTML('span', {style: { color: '#711'}}, xdate.toDateString() + " (Report is
due)");
 			}
 			return xdate ? (xdate.toDateString() + " ("  + moment(xdate).fromNow() + ")"): "Unknown(?)";

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1877614&r1=1877613&r2=1877614&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Tue May 12 01:11:57 2020
@@ -1997,8 +1997,12 @@ function getReportDate(json, pmc, dateOn
 			let xdate = new Date(+nextdate); // copy so as to not decrement multiple times
 			xdate.setDate(xdate.getDate() - 7); // Due one week prior to meeting.
 			let rightnow = new Date();
-			if (xdate <= rightnow) {
+			 // If less than 7 days till due date (14 days prior to meeting), light up the christmas
trees
+			if (xdate.diff(rightnow, 'days') < 14) {
 				if (pdata && pdata.filed[pmc] == true) return new HTML('span', {style: { color:
'#396'}}, xdate.toDateString() + " (Report filed)");
+				if (xdate.diff(rightnow, 'days') > 0) {
+					return new HTML('span', {style: { color: '#711'}}, xdate.toDateString() + " (Report
is due in %s)".format(moment(xdate).fromNow()));
+				}
 				return new HTML('span', {style: { color: '#711'}}, xdate.toDateString() + " (Report is
due)");
 			}
 			return xdate ? (xdate.toDateString() + " ("  + moment(xdate).fromNow() + ")"): "Unknown(?)";



Mime
View raw message