QuestsCalendar.js: Difference between revisions
No edit summary |
No edit summary |
||
Line 52: | Line 52: | ||
'<div class="questline_frame" bis_skin_checked="1"><div class="questline_name" bis_skin_checked="1"><b><a href="/wiki/Ringo_is_in_the_Town" title="Ringo is in the Town" bis_skin_checked="1">Ringo is in the Town</a></b></div><div class="questgiver" bis_skin_checked="1"><img alt="Barkeeper.png" src="https://wiki.the-west.net/images/2/2d/Barkeeper.png" decoding="async" width="200" height="200"></div><div class="questgiver_overlay" bis_skin_checked="1"></div><div class="info" bis_skin_checked="1">Required level: <b><span>110</span></b><br><span class="popup_txtred">From: 29/03 at 12:00<br>Until: 20/04 at 12:00</span></div></div>' + | '<div class="questline_frame" bis_skin_checked="1"><div class="questline_name" bis_skin_checked="1"><b><a href="/wiki/Ringo_is_in_the_Town" title="Ringo is in the Town" bis_skin_checked="1">Ringo is in the Town</a></b></div><div class="questgiver" bis_skin_checked="1"><img alt="Barkeeper.png" src="https://wiki.the-west.net/images/2/2d/Barkeeper.png" decoding="async" width="200" height="200"></div><div class="questgiver_overlay" bis_skin_checked="1"></div><div class="info" bis_skin_checked="1">Required level: <b><span>110</span></b><br><span class="popup_txtred">From: 29/03 at 12:00<br>Until: 20/04 at 12:00</span></div></div>' + | ||
'<div class="questline_frame" bis_skin_checked="1"><div class="questline_name" bis_skin_checked="1"><b><a href="/wiki/The_new_train_station" title="The new train station" bis_skin_checked="1">The new train station</a></b></div><div class="questgiver" bis_skin_checked="1"><img alt="Sheriffnpc.png" src="https://wiki.the-west.net/images/d/d2/Sheriffnpc.png" decoding="async" width="200" height="200"></div><div class="questgiver_overlay" bis_skin_checked="1"></div><div class="info" bis_skin_checked="1">Required level: <b><span>75</span></b><br><span class="popup_txtred">From: 29/03 at 12:00<br>Until: 20/04 at 12:00</span></div></div>', | '<div class="questline_frame" bis_skin_checked="1"><div class="questline_name" bis_skin_checked="1"><b><a href="/wiki/The_new_train_station" title="The new train station" bis_skin_checked="1">The new train station</a></b></div><div class="questgiver" bis_skin_checked="1"><img alt="Sheriffnpc.png" src="https://wiki.the-west.net/images/d/d2/Sheriffnpc.png" decoding="async" width="200" height="200"></div><div class="questgiver_overlay" bis_skin_checked="1"></div><div class="info" bis_skin_checked="1">Required level: <b><span>75</span></b><br><span class="popup_txtred">From: 29/03 at 12:00<br>Until: 20/04 at 12:00</span></div></div>', | ||
4: '<div class="questline_frame" bis_skin_checked="1"><div class="questline_name" bis_skin_checked="1"><b><a href="/wiki/Burning_spirits_of_the_past!" title="Burning spirits of the past!" bis_skin_checked="1">Burning spirits of the past!</a></b></div><div class="questgiver" bis_skin_checked="1"><img alt="Indian.png" src="https://wiki.the-west.net/images/1/19/Indian.png" decoding="async" width="200" height="200"></div><div class="questgiver_overlay" bis_skin_checked="1"></div><div class="info" bis_skin_checked="1">Required level: <b><span>66</span></b><br><span class="popup_txtred">From: 12/03 at 00:00<br>Until: | 4: '<div class="questline_frame" bis_skin_checked="1"><div class="questline_name" bis_skin_checked="1"><b><a href="/wiki/Burning_spirits_of_the_past!" title="Burning spirits of the past!" bis_skin_checked="1">Burning spirits of the past!</a></b></div><div class="questgiver" bis_skin_checked="1"><img alt="Indian.png" src="https://wiki.the-west.net/images/1/19/Indian.png" decoding="async" width="200" height="200"></div><div class="questgiver_overlay" bis_skin_checked="1"></div><div class="info" bis_skin_checked="1">Required level: <b><span>66</span></b><br><span class="popup_txtred">From: 12/03 at 00:00<br>Until: 24/04 at 23:59</span></div></div>' + | ||
'<div class="questline_frame" bis_skin_checked="1"><div class="questline_name" bis_skin_checked="1"><b><a href="/wiki/Gold_coins" title="Gold coins" bis_skin_checked="1">Gold coins</a></b></div><div class="questgiver" bis_skin_checked="1"><img alt="Barkeeper.png" src="https://wiki.the-west.net/images/2/2d/Barkeeper.png" decoding="async" width="200" height="200"></div><div class="questgiver_overlay" bis_skin_checked="1"></div><div class="info" bis_skin_checked="1">Required level: <b><span>15</span></b><br><span class="popup_txtred">From: 12/03 at 00:01<br>Until: 02/04 at 23:59</span></div></div>' + | '<div class="questline_frame" bis_skin_checked="1"><div class="questline_name" bis_skin_checked="1"><b><a href="/wiki/Gold_coins" title="Gold coins" bis_skin_checked="1">Gold coins</a></b></div><div class="questgiver" bis_skin_checked="1"><img alt="Barkeeper.png" src="https://wiki.the-west.net/images/2/2d/Barkeeper.png" decoding="async" width="200" height="200"></div><div class="questgiver_overlay" bis_skin_checked="1"></div><div class="info" bis_skin_checked="1">Required level: <b><span>15</span></b><br><span class="popup_txtred">From: 12/03 at 00:01<br>Until: 02/04 at 23:59</span></div></div>' + | ||
'<div class="questline_frame" bis_skin_checked="1"><div class="questline_name" bis_skin_checked="1"><b><a href="/wiki/Brewing_Bad_(repeatable)" title="Brewing Bad (repeatable)" bis_skin_checked="1">Brewing Bad (repeatable)</a></b></div><div class="questgiver" bis_skin_checked="1"><img alt="Barkeeper.png" src="https://wiki.the-west.net/images/2/2d/Barkeeper.png" decoding="async" width="200" height="200"></div><div class="questgiver_overlay" bis_skin_checked="1"></div><div class="info" bis_skin_checked="1">Required level: <b><span>35</span></b><br><span class="popup_txtred">From: 17/03 at 10:00<br>Until: 09/04 at 23:59</span></div></div>' + | '<div class="questline_frame" bis_skin_checked="1"><div class="questline_name" bis_skin_checked="1"><b><a href="/wiki/Brewing_Bad_(repeatable)" title="Brewing Bad (repeatable)" bis_skin_checked="1">Brewing Bad (repeatable)</a></b></div><div class="questgiver" bis_skin_checked="1"><img alt="Barkeeper.png" src="https://wiki.the-west.net/images/2/2d/Barkeeper.png" decoding="async" width="200" height="200"></div><div class="questgiver_overlay" bis_skin_checked="1"></div><div class="info" bis_skin_checked="1">Required level: <b><span>35</span></b><br><span class="popup_txtred">From: 17/03 at 10:00<br>Until: 09/04 at 23:59</span></div></div>' + |
Revision as of 22:43, 22 April 2023
var questCalendarDict = {
1: '
From: 23/01 at 10:00
Until: 29/01 at 23:59
' + '
From: 23/01 at 10:00
Until: 29/01 at 23:59
' + '
From: 31/01 at 10:00
Until: 05/03 at 23:59
' + '
From: 31/01 at 10:00
Until: 05/03 at 23:59
', 2: '
From: 31/01 at 10:00
Until: 05/03 at 23:59
' + '
From: 31/01 at 10:00
Until: 05/03 at 23:59
' + '
From: 01/02 at 12:00
Until: 15/02 at 12:00
' + '
From: 01/02 at 12:00
Until: 15/02 at 12:00
' + '
From: 01/02 at 12:00
Until: 15/02 at 12:00
' + '
From: 01/02 at 12:00
Until: 15/02 at 12:00
' + '
From: 13/02 at 10:00
Until: 04/03 at 23:59
' + '
From: 14/02 at 00:00
Until: 17/02 at 23:59
' + '
From: 14/02 at 00:00
Until: 17/02 at 23:59
' + '
From: 14/02 at 10:00
Until: 02/03 at 23:59
' + '
From: 14/02 at 10:00
Until: 03/03 at 23:59
' + '
From: 14/02 at 10:00
Until: 08/03 at 11:59
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 17/02 at 12:00
Until: 08/03 at 12:00
', 3: '
From: 31/01 at 10:00
Until: 05/03 at 23:59
' + '
From: 31/01 at 10:00
Until: 05/03 at 23:59
' + '
From: 13/02 at 10:00
Until: 04/03 at 23:59
' + '
From: 14/02 at 10:00
Until: 02/03 at 23:59
' + '
From: 14/02 at 10:00
Until: 03/03 at 23:59
' + '
From: 14/02 at 10:00
Until: 08/03 at 11:59
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 15/02 at 12:00
Until: 06/03 at 12:00
' + '
From: 17/02 at 12:00
Until: 08/03 at 12:00
' + '
From: 06/03 at 11:00
Until: 20/03 at 23:59
' + '
From: 12/03 at 00:00
Until: 24/04 at 23:59
' + '
From: 12/03 at 00:01
Until: 02/04 at 23:59
' + '
From: 15/03 at 12:00
Until: 29/03 at 12:00
' + '
From: 15/03 at 12:00
Until: 29/03 at 12:00
' + '
From: 17/03 at 10:00
Until: 23/03 at 23:59
' + '
From: 17/03 at 10:00
Until: 09/04 at 23:59
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
', 4: '
From: 12/03 at 00:00
Until: 24/04 at 23:59
' + '
From: 12/03 at 00:01
Until: 02/04 at 23:59
' + '
From: 17/03 at 10:00
Until: 09/04 at 23:59
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 29/03 at 12:00
Until: 20/04 at 12:00
' + '
From: 01/04 at 00:00
Until: 04/04 at 23:59
' + '
From: 01/04 at 00:00
Until: 30/04 at 23:59
' + '
From: 01/04 at 00:01
Until: 01/04 at 23:59
' + '
From: 06/04 at 00:00
Until: 23/04 at 23:59
' + '
From: 06/04 at 00:00
Until: 26/04 at 23:59
' + '
From: 06/04 at 00:00
Until: 26/04 at 23:59
' + '
From: 09/04 at 00:00
Until: 22/04 at 23:59
' + '
From: 29/04 at 12:00
Until: 20/05 at 12:00
' + '
From: 29/04 at 12:00
Until: 20/05 at 12:00
' + '
From: 30/04 at 00:00
Until: 20/05 at 23:59
' + '
From: 30/04 at 00:00
Until: 23/05 at 23:59
' + '
From: 30/04 at 10:00
Until: 10/05 at 23:59
' + '
From: 30/04 at 10:00
Until: 10/05 at 23:59
', 5: '
From: 29/04 at 12:00
Until: 20/05 at 12:00
' + '
From: 29/04 at 12:00
Until: 20/05 at 12:00
' + '
From: 30/04 at 00:00
Until: 20/05 at 23:59
' + '
From: 30/04 at 00:00
Until: 23/05 at 23:59
' + '
From: 30/04 at 10:00
Until: 10/05 at 23:59
' + '
From: 30/04 at 10:00
Until: 10/05 at 23:59
' + '
From: 06/05 at 10:00
Until: 11/05 at 23:59
' + '
From: 06/05 at 10:00
Until: 11/05 at 23:59
' + '
From: 20/05 at 12:00
Until: 08/06 at 12:00
' + '
From: 20/05 at 12:00
Until: 08/06 at 12:00
' + '
From: 25/05 at 10:00
Until: 31/05 at 23:59
', 6: '
From: 20/05 at 12:00
Until: 08/06 at 12:00
' + '
From: 20/05 at 12:00
Until: 08/06 at 12:00
' + '
From: 16/06 at 00:00
Until: 26/06 at 23:59
' + '
From: 22/06 at 10:00
Until: 28/06 at 23:59
' + '
From: 22/06 at 10:00
Until: 28/06 at 23:59
', 7: '
From: 01/07 at 00:00
Until: 14/07 at 23:59
' + '
From: 01/07 at 00:00
Until: 14/07 at 23:59
' + '
From: 01/07 at 00:00
Until: 14/07 at 23:59
' + '
From: 02/07 at 11:00
Until: 23/07 at 23:59
' + '
From: 04/07 at 00:00
Until: 24/07 at 23:59
' + '
From: 04/07 at 11:00
Until: 25/07 at 23:59
' + '
From: 07/07 at 12:00
Until: 22/07 at 12:00
' + '
From: 17/07 at 08:00
Until: 30/07 at 23:59
' + '
From: 29/07 at 10:00
Until: 09/08 at 23:59
' + '
From: 29/07 at 10:00
Until: 09/08 at 23:59
', 8: '
From: 29/07 at 10:00
Until: 09/08 at 23:59
' + '
From: 29/07 at 10:00
Until: 09/08 at 23:59
' + '
From: 08/08 at 10:00
Until: 14/08 at 23:59
' + '
From: 08/08 at 10:00
Until: 14/08 at 23:59
' + '
From: 11/08 at 11:00
Until: 30/09 at 23:59
' + '
From: 15/08 at 10:00
Until: 31/08 at 23:59
' + '
From: 27/08 at 10:00
Until: 02/09 at 23:59
' + '
From: 27/08 at 10:00
Until: 02/09 at 23:59
', 9: '
From: 11/08 at 11:00
Until: 30/09 at 23:59
' + '
From: 27/08 at 10:00
Until: 02/09 at 23:59
' + '
From: 27/08 at 10:00
Until: 02/09 at 23:59
' + '
From: 12/09 at 11:00
Until: 06/10 at 23:59
' + '
From: 16/09 at 12:00
Until: 13/10 at 12:00
' + '
From: 16/09 at 12:00
Until: 13/10 at 12:00
' + '
From: 16/09 at 12:00
Until: 13/10 at 12:00
' + '
From: 17/09 at 12:00
Until: 14/10 at 12:00
' + '
From: 18/09 at 12:00
Until: 14/10 at 23:59
', 10: '
From: 12/09 at 11:00
Until: 06/10 at 23:59
' + '
From: 16/09 at 12:00
Until: 13/10 at 12:00
' + '
From: 16/09 at 12:00
Until: 13/10 at 12:00
' + '
From: 16/09 at 12:00
Until: 13/10 at 12:00
' + '
From: 17/09 at 12:00
Until: 14/10 at 12:00
' + '
From: 18/09 at 12:00
Until: 14/10 at 23:59
' + '
From: 12/10 at 11:00
Until: 30/11 at 23:59
' + '
From: 14/10 at 00:00
Until: 14/11 at 23:59
' + '
From: 14/10 at 00:00
Until: 14/11 at 23:59
' + '
From: 16/10 at 00:00
Until: 18/11 at 23:59
' + '
From: 25/10 at 10:00
Until: 29/11 at 23:59
' + '
From: 27/10 at 00:00
Until: 04/11 at 23:59
' + '
From: 28/10 at 10:00
Until: 20/11 at 23:59
' + '
From: 28/10 at 10:00
Until: 21/11 at 23:59
' + '
From: 28/10 at 12:00
Until: 16/11 at 12:00
' + '
From: 30/10 at 00:00
Until: 04/11 at 23:59
' + '
From: 30/10 at 00:00
Until: 07/11 at 23:59
', 11: '
From: 12/10 at 11:00
Until: 30/11 at 23:59
' + '
From: 14/10 at 00:00
Until: 14/11 at 23:59
' + '
From: 14/10 at 00:00
Until: 14/11 at 23:59
' + '
From: 16/10 at 00:00
Until: 18/11 at 23:59
' + '
From: 25/10 at 10:00
Until: 29/11 at 23:59
' + '
From: 27/10 at 00:00
Until: 04/11 at 23:59
' + '
From: 28/10 at 10:00
Until: 20/11 at 23:59
' + '
From: 28/10 at 10:00
Until: 21/11 at 23:59
' + '
From: 28/10 at 12:00
Until: 16/11 at 12:00
' + '
From: 30/10 at 00:00
Until: 04/11 at 23:59
' + '
From: 30/10 at 00:00
Until: 07/11 at 23:59
' + '
From: 05/11 at 12:00
Until: 23/11 at 12:00
' + '
From: 05/11 at 12:00
Until: 23/11 at 12:00
' + '
From: 11/11 at 10:00
Until: 02/12 at 23:59
' + '
From: 11/11 at 10:00
Until: 02/12 at 23:59
' + '
From: 23/11 at 00:00
Until: 30/11 at 23:59
' + '
From: 23/11 at 00:00
Until: 30/11 at 23:59
' + '
From: 24/11 at 00:00
Until: 05/12 at 23:59
', 12: '
From: 11/11 at 10:00
Until: 02/12 at 23:59
' + '
From: 11/11 at 10:00
Until: 02/12 at 23:59
' + '
From: 24/11 at 00:00
Until: 05/12 at 23:59
' + '
From: 01/12 at 00:01
Until: 31/12 at 23:59
' + '
From: 06/12 at 00:00
Until: 26/12 at 23:59
' + '
From: 06/12 at 00:00
Until: 26/12 at 23:59
' + '
From: 18/12 at 11:00
Until: 31/12 at 23:59
',
};
(function($) { $(document).ready(function() { var now = new Date(); var currentMonth = now.getMonth() + 1; var currentYear = now.getFullYear();
var currentMonthDiv = document.getElementById("current-month"); var nextMonthDiv = document.getElementById("next-month");
if (currentMonthDiv && nextMonthDiv) { currentMonthDiv.innerHTML = getMonthName(currentMonth);
var nextMonth = currentMonth + 1; var nextMonthYear = currentYear; if (nextMonth > 12) { nextMonth = 1; nextMonthYear++; } nextMonthDiv.innerHTML = getMonthName(nextMonth); }
function getMonthName(month) { var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; return monthNames[month - 1]; }
// Get the quests for the current month and next month from the questCalendarDict var currentMonthQuests = questCalendarDict[currentMonth];
console.log(currentMonthQuests);
var nextMonthQuests = questCalendarDict[currentMonth + 1];
if (currentMonthQuests) { loadQuests(currentMonthQuests, "#current-month-quests"); } if (nextMonthQuests) { loadQuests(nextMonthQuests, "#next-month-quests"); }
function loadQuests(questsString, container) { // Split the quests string into an array of quest strings var questStrings = questsString.split("\n");
for (var i = 0; i < questStrings.length; i++) { var quest = questStrings[i]; $(container).append(quest); } }
// Find all quest spans var questSpans = $('.questline_frame span.popup_txtred');
questSpans.each(function() { var span = $(this); var dateString = span.html();
var startDateString = dateString.substring(6, 16) + dateString.substring(20, 25); var endDateString = dateString.substring(29, 39) + dateString.substring(43, 48);
var startDate = new Date(startDateString); var endDate = new Date(endDateString);
var now = new Date();
// If the current date is between the start and end dates, update the class of the span if (now >= startDate && now <= endDate) { span.removeClass('popup_txtred'); span.addClass('popup_txtgreen'); } });
}); })(jQuery);