diff --git a/__fixtures__/wotlk-dates.js b/__fixtures__/wotlk-dates.js
new file mode 100644
index 0000000..f1fe0bb
--- /dev/null
+++ b/__fixtures__/wotlk-dates.js
@@ -0,0 +1,68 @@
+export const wrathDates = [
+ [
+ {
+ key: "arathi",
+ date: new Date(2022, 8, 30), // sept
+ },
+ {
+ key: "strand",
+ date: new Date(2022, 9, 7), // oct
+ },
+ {
+ key: "alterac",
+ date: new Date(2022, 9, 14), // oct
+ },
+ {
+ key: "eye",
+ date: new Date(2022, 9, 21), // oct
+ },
+ {
+ key: "warsong",
+ date: new Date(2022, 9, 28), // oct
+ },
+ ],
+ [
+ {
+ key: "arathi",
+ date: new Date(2022, 10, 4), // nov
+ },
+ {
+ key: "strand",
+ date: new Date(2022, 10, 11), // nov
+ },
+ {
+ key: "alterac",
+ date: new Date(2022, 10, 18), // nov
+ },
+ {
+ key: "eye",
+ date: new Date(2022, 10, 25), // nov
+ },
+ {
+ key: "warsong",
+ date: new Date(2022, 11, 2), // dec
+ },
+ ],
+ [
+ {
+ key: "arathi",
+ date: new Date(2022, 11, 9), // dec
+ },
+ {
+ key: "strand",
+ date: new Date(2022, 11, 16), // dec
+ },
+ {
+ key: "alterac",
+ date: new Date(2022, 11, 23), // dec
+ },
+ {
+ key: "eye",
+ date: new Date(2022, 11, 30), // dec
+ },
+ {
+ key: "warsong",
+ date: "",
+ },
+ ],
+];
diff --git a/__tests__/wotlk-dates.test.js b/__tests__/wotlk-dates.test.js
new file mode 100644
index 0000000..4bf6847
--- /dev/null
+++ b/__tests__/wotlk-dates.test.js
@@ -0,0 +1,24 @@
+import { wrathDates } from "../__fixtures__/wotlk-dates.js";
+import { getWOTLKHolidays } from "../helpers/date-helper.js";
+
+it("should contain the correct WOTLK dates for 2022", () => {
+ const holidays = getWOTLKHolidays(2022);
+ for (let i = 0; i < holidays.length; i++) {
+ for (let j = 0; j < holidays[i].length; j++) {
+ const firstKey = wrathDates[i][j].key;
+ const secondKey = holidays[i][j].key;
+
+ const firstDateStr =
+ wrathDates[i][j].date === ""
+ ? wrathDates[i][j].date
+ : wrathDates[i][j].date.toLocaleDateString();
+ const secondDateStr =
+ holidays[i][j].date === ""
+ ? holidays[i][j].date
+ : holidays[i][j].date.toLocaleDateString();
+
+ expect(firstKey).toEqual(secondKey);
+ expect(firstDateStr).toEqual(secondDateStr);
+ }
+ }
+});
diff --git a/babel.config.json b/babel.config.json
new file mode 100644
index 0000000..394c543
--- /dev/null
+++ b/babel.config.json
@@ -0,0 +1,12 @@
+{
+ "presets": [
+ [
+ "@babel/preset-env",
+ {
+ "targets": {
+ "node": "current"
+ }
+ }
+ ]
+ ]
+}
diff --git a/helpers/date-helper.js b/helpers/date-helper.js
new file mode 100644
index 0000000..511f592
--- /dev/null
+++ b/helpers/date-helper.js
@@ -0,0 +1,83 @@
+export const getWOTLKHolidays = (year) => {
+ const arathiEpoch = new Date(2022, 8, 30);
+ const strandEpoch = new Date(2022, 9, 7);
+ const alteracEpoch = new Date(2022, 9, 14);
+ const eyeOfTheStormEpoch = new Date(2022, 9, 21);
+ const warsongEpoch = new Date(2022, 9, 28);
+ const start = new Date(arathiEpoch.getTime());
+
+ let i = 0;
+ const dates = [];
+ while (start.getFullYear() <= year) {
+ const row = [
+ {
+ key: "arathi",
+ date: "",
+ },
+ {
+ key: "strand",
+ date: "",
+ },
+ {
+ key: "alterac",
+ date: "",
+ },
+ {
+ key: "eye",
+ date: "",
+ },
+ {
+ key: "warsong",
+ date: "",
+ },
+ ];
+
+ const fiveWeeksInDays = 35;
+ const arathiDate = new Date(arathiEpoch);
+ arathiDate.setDate(arathiDate.getDate() + fiveWeeksInDays * i);
+
+ const strandDate = new Date(strandEpoch);
+ strandDate.setDate(strandDate.getDate() + fiveWeeksInDays * i);
+
+ const alteracDate = new Date(alteracEpoch);
+ alteracDate.setDate(alteracDate.getDate() + fiveWeeksInDays * i);
+
+ const eyeOfTheStormDate = new Date(eyeOfTheStormEpoch);
+ eyeOfTheStormDate.setDate(
+ eyeOfTheStormDate.getDate() + fiveWeeksInDays * i
+ );
+
+ const warsongDate = new Date(warsongEpoch);
+ warsongDate.setDate(warsongDate.getDate() + fiveWeeksInDays * i);
+
+ let added = false;
+ if (arathiDate.getFullYear() === year) {
+ row[0].date = arathiDate;
+ added = true;
+ }
+ if (strandDate.getFullYear() === year) {
+ row[1].date = strandDate;
+ added = true;
+ }
+ if (alteracDate.getFullYear() === year) {
+ row[2].date = alteracDate;
+ added = true;
+ }
+ if (eyeOfTheStormDate.getFullYear() === year) {
+ row[3].date = eyeOfTheStormDate;
+ added = true;
+ }
+ if (warsongDate.getFullYear() === year) {
+ row[4].date = warsongDate;
+ added = true;
+ }
+
+ if (added) {
+ dates.push(row);
+ }
+ start.setDate(start.getDate() + fiveWeeksInDays);
+ i++;
+ }
+
+ return dates;
+};
diff --git a/index.html b/index.html
index 7a2ff9a..c7d3a69 100644
--- a/index.html
+++ b/index.html
@@ -5,7 +5,7 @@
WoW Classic Battleground Holidays 2022
@@ -33,9 +33,9 @@
WoW Classic Battleground Holidays 2022
-
-
- Burning Crusade Classic
+
+
+ Wrath of the Lich King Classic
-
-
-
- Season of Mastery
-
-
-
-
-
-
- Warsong Gulch |
- Arathi Basin |
- Alterac Valley |
-
-
-
-
-
- |
-
-
-
- |
-
-
-
|
@@ -164,7 +112,7 @@ Season of Mastery
- Classic Era
+ SoM / Classic Era