Skip to content

Commit

Permalink
Fixed converting index to weekday (Fixes #64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Casvt committed Jul 14, 2024
1 parent 06e6e6d commit 401c973
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions frontend/static/js/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@ function getSorting(type, key=false) {
return getLocalStorage(sorting_key)[sorting_key];
};

function getWeekDays(locale) {
const baseDate = new Date(Date.UTC(2017, 0, 2)); // just a Monday
const weekDays = [];
for (i = 0; i < 7; i++)
{
weekDays.push(baseDate.toLocaleDateString(locale, { weekday: 'short' }));
baseDate.setDate(baseDate.getDate() + 1);
}
return weekDays;
};

function getActiveTab() {
for (let t of Object.values(Types)) {
if (getComputedStyle(t).display === 'flex')
Expand Down Expand Up @@ -159,7 +148,7 @@ function evaluateSizing() {
Object.values(Types).forEach(t => fillLibrary(t));
setInterval(() => fillLibrary(Types.reminder), 60000);

const week_days = getWeekDays(getLocalStorage('locale')['locale']);
const week_days = ["Mo", "Tu", "We", "Thu", "Fr", "Sa", "Su"];

NavButtons.home.onclick = e => showWindow("home");
NavButtons.notification_services.onclick = e => showWindow("notification");
Expand Down

0 comments on commit 401c973

Please sign in to comment.