Author: sebb
Date: Sun Jul 6 16:24:29 2025
New Revision: 1927010
URL: http://svn.apache.org/viewvc?rev=1927010&view=rev
Log:
No longer need to calculate the meeting date
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=1927010&r1=1927009&r2=1927010&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 16:24:29 2025
@@ -1,43 +1,5 @@
// Grabbed from old reporter.a.o
-// return all the Wednesdays in the month
-const reporting_date_shifts = { // Dates that are known to have shifted by N
weeks
- "2023-03": 1 // shifted by 1 week
-}
-
-function getWednesdays(mo, y) {
- let d = new Date();
- d.setFullYear(y, mo, 1)
- let month = d.getMonth(),
- wednesdays = [];
-
- // Get the first Wednesday (day 3 of week) in the month
- while (d.getDay() !== 3) {
- d.setDate(d.getDate() + 1);
- }
-
- // Get all the other Wednesdays in the month
- while (d.getMonth() === month) {
- wednesdays.push(new Date(d.getTime()));
- d.setDate(d.getDate() + 7);
- }
- // Check for shifts, adjust if found
- d.setMonth(mo);
- const caldate = moment(d).format('YYYY-MM');
- if (reporting_date_shifts[caldate]) {
- wednesdays = wednesdays.slice(reporting_date_shifts[caldate]);
- }
- return wednesdays;
-}
-// check if the entry is a wildcard month
-
-function everyMonth(s) {
- if (s.indexOf('Next month') == 0) {
- return true
- }
- return s == 'Every month'
-}
-
let m = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December']
// Format the report month array. Assumes that non-month values appear first
@@ -53,49 +15,6 @@ function formatRm(array) {
return array.join(', ')
}
-function getNextWed(rm) {
-
- let today = new Date()
-
- let dates = [] // the entries must be in date order
-
- // 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++) {
- let sm = rm[i];
- if (everyMonth(sm)) {
- rm = m // reset to every month
- break
- }
- }
-
- // Find the 3rd Wed in each month for this year
- let this_year = today.getFullYear();
- // Check the months in order, so it does not matter if the data is
unordered
- for (let x = 0; x < m.length; x++) {
- for (let i = 0; i < rm.length; i++) {
- if (m[x] == rm[i]) {
- dates.push(getWednesdays(x, this_year)[2])
- }
- }
- }
- // Also for next year to allow for year-end wrap-round
- // cannot combine with the code above because that would destroy the
order
- for (let x = 0; x < m.length; x++) {
- for (let i = 0; i < rm.length; i++) {
- if (m[x] == rm[i]) {
- dates.push(getWednesdays(x, this_year+1)[2])
- }
- }
- }
- // find the first Wed that has not been reached
- let nextdate = dates[0];
- 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
@@ -107,7 +26,7 @@ function getReportDate(json, pmc, dateOn
rm = json[pmc].slice(1) // Drop the prefix
nextdate = new Date(first * 1000)
} else {
- nextdate = getNextWed(rm)
+ alert('epoch prefix is missing!')
}
if (agenda) return
"board_agenda_%s.txt".format(moment(nextdate).format('YYYY_MM_DD'));
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=1927010&r1=1927009&r2=1927010&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
16:24:29 2025
@@ -1912,44 +1912,6 @@ function prime_steps(state, json) {
// Grabbed from old reporter.a.o
-// return all the Wednesdays in the month
-const reporting_date_shifts = { // Dates that are known to have shifted by N
weeks
- "2023-03": 1 // shifted by 1 week
-}
-
-function getWednesdays(mo, y) {
- let d = new Date();
- d.setFullYear(y, mo, 1)
- let month = d.getMonth(),
- wednesdays = [];
-
- // Get the first Wednesday (day 3 of week) in the month
- while (d.getDay() !== 3) {
- d.setDate(d.getDate() + 1);
- }
-
- // Get all the other Wednesdays in the month
- while (d.getMonth() === month) {
- wednesdays.push(new Date(d.getTime()));
- d.setDate(d.getDate() + 7);
- }
- // Check for shifts, adjust if found
- d.setMonth(mo);
- const caldate = moment(d).format('YYYY-MM');
- if (reporting_date_shifts[caldate]) {
- wednesdays = wednesdays.slice(reporting_date_shifts[caldate]);
- }
- return wednesdays;
-}
-// check if the entry is a wildcard month
-
-function everyMonth(s) {
- if (s.indexOf('Next month') == 0) {
- return true
- }
- return s == 'Every month'
-}
-
let m = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December']
// Format the report month array. Assumes that non-month values appear first
@@ -1965,49 +1927,6 @@ function formatRm(array) {
return array.join(', ')
}
-function getNextWed(rm) {
-
- let today = new Date()
-
- let dates = [] // the entries must be in date order
-
- // 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++) {
- let sm = rm[i];
- if (everyMonth(sm)) {
- rm = m // reset to every month
- break
- }
- }
-
- // Find the 3rd Wed in each month for this year
- let this_year = today.getFullYear();
- // Check the months in order, so it does not matter if the data is
unordered
- for (let x = 0; x < m.length; x++) {
- for (let i = 0; i < rm.length; i++) {
- if (m[x] == rm[i]) {
- dates.push(getWednesdays(x, this_year)[2])
- }
- }
- }
- // Also for next year to allow for year-end wrap-round
- // cannot combine with the code above because that would destroy the
order
- for (let x = 0; x < m.length; x++) {
- for (let i = 0; i < rm.length; i++) {
- if (m[x] == rm[i]) {
- dates.push(getWednesdays(x, this_year+1)[2])
- }
- }
- }
- // find the first Wed that has not been reached
- let nextdate = dates[0];
- 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
@@ -2019,7 +1938,7 @@ function getReportDate(json, pmc, dateOn
rm = json[pmc].slice(1) // Drop the prefix
nextdate = new Date(first * 1000)
} else {
- nextdate = getNextWed(rm)
+ alert('epoch prefix is missing!')
}
if (agenda) return
"board_agenda_%s.txt".format(moment(nextdate).format('YYYY_MM_DD'));