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(?)";


Reply via email to