From 5f1baa458894de2487e4160181630607716c165a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dembowski?= Date: Fri, 24 Sep 2021 06:45:59 +0000 Subject: [PATCH] [en] Update events.js --- locale/en/events.js | 46 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/locale/en/events.js b/locale/en/events.js index d8fc46353..85bbdb9e6 100644 --- a/locale/en/events.js +++ b/locale/en/events.js @@ -63,11 +63,55 @@ module.exports = [ }, EventLevel.MajorDay), new Event('Spirit Day', null, 10, function* (monthDays) { + let fridays = 0; + for (let d of monthDays) { + if (d.dayOfWeek === 4) { + thursdays++; + if (thursdays === 3) { + yield d; + return; + } + } + } + }, EventLevel.MajorDay), + + new Event('Purple Friday (UK)', null, 2, function* (monthDays) { + let lastFriday = null; + for (let d of monthDays) { + if (d.dayOfWeek === 5) { + lastFriday = d; + } + } + yield lastFriday; + }, EventLevel.MajorDay), + + new Event('Purple Friday (UK)', null, 2, function* (monthDays) { + let lastFriday = null; + for (let d of monthDays) { + if (d.dayOfWeek === 5) { + lastFriday = d; + } + } + yield lastFriday; + }, EventLevel.MajorDay), + + new Event('Rainbow Friday (Poland)', null, 10, function* (monthDays) { + let lastFriday = null; + for (let d of monthDays) { + if (d.dayOfWeek === 5) { + lastFriday = d; + } + } + yield lastFriday; + }, EventLevel.MajorDay), +]; + + new Event('Purple Friday (Netherlands)', null, 12, function* (monthDays) { let fridays = 0; for (let d of monthDays) { if (d.dayOfWeek === 5) { fridays++; - if (fridays === 3) { + if (fridays === 2) { yield d; return; }