mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-28 07:20:49 -04:00
[calendar] add aids_memorial, health_week, lesbian_visibility_week
This commit is contained in:
parent
84fb2d1ecc
commit
9f6180317b
@ -1,4 +1,4 @@
|
|||||||
import {Event, day, week, month, EventLevel} from "../../src/calendar/helpers";
|
import {Event, Day, day, week, month, EventLevel} from "../../src/calendar/helpers";
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
// months
|
// months
|
||||||
@ -137,4 +137,44 @@ export default [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, EventLevel.MajorDay),
|
}, EventLevel.MajorDay),
|
||||||
|
|
||||||
|
new Event('aids_memorial', null, 5, function* (monthDays) {
|
||||||
|
let sundays = 0;
|
||||||
|
for (let d of monthDays) {
|
||||||
|
if (d.dayOfWeek === 7) {
|
||||||
|
sundays++;
|
||||||
|
if (sundays === 3) {
|
||||||
|
yield d;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, EventLevel.MajorDay),
|
||||||
|
|
||||||
|
new Event('health_week', null, 3, week(function* (monthDays) {
|
||||||
|
let prevBuffer = [];
|
||||||
|
let buffer = [];
|
||||||
|
for (let d of monthDays) {
|
||||||
|
if (d.dayOfWeek <= 5) {
|
||||||
|
buffer.push(d);
|
||||||
|
}
|
||||||
|
if (d.dayOfWeek === 5) {
|
||||||
|
prevBuffer = buffer;
|
||||||
|
buffer = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yield* prevBuffer;
|
||||||
|
}), EventLevel.Week),
|
||||||
|
|
||||||
|
new Event('lesbian_visibility_week', 'Lesbian', 4, week(function* (monthDays) {
|
||||||
|
let lastDay = null;
|
||||||
|
for (let d of monthDays) {
|
||||||
|
if (d.day >= 26) {
|
||||||
|
yield d;
|
||||||
|
}
|
||||||
|
lastDay = d;
|
||||||
|
}
|
||||||
|
yield new Day(lastDay.year, 5, 1);
|
||||||
|
yield new Day(lastDay.year, 5, 2);
|
||||||
|
}), EventLevel.Week),
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user