Author: sebb Date: Sun Jul 6 13:10:00 2025 New Revision: 1927001 URL: http://svn.apache.org/viewvc?rev=1927001&view=rev Log: Isolate date calc in separate function
Modified: comdev/reporter.apache.org/trunk/site/wizard/index.html comdev/reporter.apache.org/trunk/site/wizard/js/source/reportdate.js comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js comdev/reporter.apache.org/trunk/site/wizard/statistics.html Modified: comdev/reporter.apache.org/trunk/site/wizard/index.html URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/index.html?rev=1927001&r1=1927000&r2=1927001&view=diff ============================================================================== --- comdev/reporter.apache.org/trunk/site/wizard/index.html (original) +++ comdev/reporter.apache.org/trunk/site/wizard/index.html Sun Jul 6 13:10:00 2025 @@ -67,6 +67,6 @@ <script src="js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> <script src="js/moment.min.js"></script> <script src="highlighter/highlighter.js" type="text/javascript"></script> -<script src="js/wizard.js?1751806766" type="text/javascript"></script> +<script src="js/wizard.js?1751807295" type="text/javascript"></script> </body> </html> 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=1927001&r1=1927000&r2=1927001&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 Sun Jul 6 13:10:00 2025 @@ -53,13 +53,12 @@ function formatRm(array) { return array.join(', ') } -function getReportDate(json, pmc, dateOnly, agenda) { +function getNextWed() { + let today = new Date() let dates = [] // the entries must be in date order - let rm = json[pmc] // reporting months for the pmc - // First check if the list contains an every month indicator // This is necessary to ensure that the dates are added to the list in order for (let i = 0; i < rm.length; i++) { @@ -94,6 +93,15 @@ function getReportDate(json, pmc, dateOn while (nextdate < today && dates.length > 0) { nextdate = dates.shift(); } + return nextdate +} + +function getReportDate(json, pmc, dateOnly, agenda) { + + let rm = json[pmc] // reporting months for the pmc + + let nextdate = getNextWed(rm) + if (agenda) return "board_agenda_%s.txt".format(moment(nextdate).format('YYYY_MM_DD')); if (dateOnly) { // agenda date or due date? 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=1927001&r1=1927000&r2=1927001&view=diff ============================================================================== --- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original) +++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Sun Jul 6 13:10:00 2025 @@ -1965,13 +1965,12 @@ function formatRm(array) { return array.join(', ') } -function getReportDate(json, pmc, dateOnly, agenda) { +function getNextWed() { + let today = new Date() let dates = [] // the entries must be in date order - let rm = json[pmc] // reporting months for the pmc - // First check if the list contains an every month indicator // This is necessary to ensure that the dates are added to the list in order for (let i = 0; i < rm.length; i++) { @@ -2006,6 +2005,15 @@ function getReportDate(json, pmc, dateOn while (nextdate < today && dates.length > 0) { nextdate = dates.shift(); } + return nextdate +} + +function getReportDate(json, pmc, dateOnly, agenda) { + + let rm = json[pmc] // reporting months for the pmc + + let nextdate = getNextWed(rm) + if (agenda) return "board_agenda_%s.txt".format(moment(nextdate).format('YYYY_MM_DD')); if (dateOnly) { // agenda date or due date? Modified: comdev/reporter.apache.org/trunk/site/wizard/statistics.html URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/statistics.html?rev=1927001&r1=1927000&r2=1927001&view=diff ============================================================================== --- comdev/reporter.apache.org/trunk/site/wizard/statistics.html (original) +++ comdev/reporter.apache.org/trunk/site/wizard/statistics.html Sun Jul 6 13:10:00 2025 @@ -67,7 +67,7 @@ <script src="highlighter/highlighter.js" type="text/javascript"></script> <script src="js/d3.js" type="text/javascript"></script> <script src="js/c3.js" type="text/javascript"></script> -<script src="js/wizard.js?1751806766" type="text/javascript"></script> +<script src="js/wizard.js?1751807295" type="text/javascript"></script> </body> </html>