Skip to content

Commit 11aa745

Browse files
authored
Next attempt to calculate planning meetings table. (#148)
1 parent 34040f1 commit 11aa745

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

docs/contributing/02-planning-meetings.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ export function PlanningMeetingDatesTable() {
2727
const nextMonday = new Date();
2828
nextMonday.setDate(nextMonday.getDate() + daysUntilMonday)
2929

30-
const currentWeek = Math.ceil((nextMonday.getDate() + 1) / 7);
31-
const currentYear = nextMonday.getFullYear();
32-
if (currentWeek % 2 !== 0) {
30+
let onejan = new Date(today.getFullYear(), 0, 1);
31+
let week = Math.ceil((((nextMonday.getTime() - onejan.getTime()) / 86400000) + onejan.getDay() + 1) / 7);
32+
33+
if (week % 2 === 0) {
3334
nextMonday.setDate(nextMonday.getDate() + 7)
3435
}
3536

versioned_docs/version-v0.21.11/contributing/02-planning-meetings.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ export function PlanningMeetingDatesTable() {
2727
const nextMonday = new Date();
2828
nextMonday.setDate(nextMonday.getDate() + daysUntilMonday)
2929

30-
const currentWeek = Math.ceil((nextMonday.getDate() + 1) / 7);
31-
const currentYear = nextMonday.getFullYear();
32-
if (currentWeek % 2 !== 0) {
30+
let onejan = new Date(today.getFullYear(), 0, 1);
31+
let week = Math.ceil((((nextMonday.getTime() - onejan.getTime()) / 86400000) + onejan.getDay() + 1) / 7);
32+
33+
if (week % 2 === 0) {
3334
nextMonday.setDate(nextMonday.getDate() + 7)
3435
}
3536

versioned_docs/version-v0.22.0/contributing/02-planning-meetings.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ export function PlanningMeetingDatesTable() {
2727
const nextMonday = new Date();
2828
nextMonday.setDate(nextMonday.getDate() + daysUntilMonday)
2929

30-
const currentWeek = Math.ceil((nextMonday.getDate() + 1) / 7);
31-
const currentYear = nextMonday.getFullYear();
32-
if (currentWeek % 2 !== 0) {
30+
let onejan = new Date(today.getFullYear(), 0, 1);
31+
let week = Math.ceil((((nextMonday.getTime() - onejan.getTime()) / 86400000) + onejan.getDay() + 1) / 7);
32+
33+
if (week % 2 === 0) {
3334
nextMonday.setDate(nextMonday.getDate() + 7)
3435
}
3536

0 commit comments

Comments
 (0)