[en][calendar] mspec lesbian awareness

This commit is contained in:
Andrea 2022-04-10 01:47:59 +02:00
parent 96a76ea76f
commit ba3f5c29a6
3 changed files with 17 additions and 1 deletions

View File

@ -1,4 +1,4 @@
const {Event, day, week, month, dayYear, EventLevel, Day} = require("../../../src/calendar/helpers");
const {Event, day, week, month, dayYear, weekStarting, EventLevel, Day} = require("../../../src/calendar/helpers");
module.exports = [
// --- months ---
@ -65,6 +65,8 @@ module.exports = [
new Event('{https://www.instagram.com/p/CY_mGaGo9sm/=Nonbinary Grandparents\' Day} (Poland)', 'Nonbinary', 1, day(23), EventLevel.Day, ['nonbinary']),
new Event('Anniversary of the death of Marielle Franco (Brazil)', '_black-ribbon', 3, day(14), EventLevel.Day),
new Event('{https://standbyme.uk/nbad/=Bystander Awareness Day} (UK)', null, 3, day(13), EventLevel.Day),
new Event('{https://twitter.com/MspecLesbianss=Mspec Lesbian Visbility & Awareness Day}', '_mspec_lesbians', 5, day(26), EventLevel.Day),
new Event('{https://twitter.com/MspecLesbianss=Mspec Lesbian Visbility & Awareness Week}', '_mspec_lesbians', 5, weekStarting(22), EventLevel.Week),
// --- dynamic date ---

View File

@ -175,6 +175,20 @@ module.exports.week = function (generator) {
return internal;
}
module.exports.weekStarting = function (start) {
function *internal (monthDays) {
let count = 0;
for (let d of monthDays) {
if (d.day >= start && count < 7) {
yield d;
count++;
}
}
}
return internal;
}
module.exports.dayYear = function (day, year) {
function *internal (monthDays) {
for (let d of monthDays) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB