Skip to content

Commit

Permalink
Merge pull request #120 from filips123/fix-timetable-details-date
Browse files Browse the repository at this point in the history
Fix timetable details date
  • Loading branch information
filips123 authored Jan 22, 2025
2 parents 61f89c6 + e5e7130 commit 43559e9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions website/src/components/TimetableDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { computed } from 'vue'
import TimetableLessonLink from '@/components/TimetableLessonLink.vue'
import { useSettingsStore } from '@/stores/settings'
import type { MergedLesson } from '@/stores/timetable'
import { getCurrentDate } from '@/utils/days'
import { getCurrentDate, getWeekdays } from '@/utils/days'
import { localizeDate, localizedWeekdays } from '@/utils/localization'
import { lessonTimes } from '@/utils/times'
Expand All @@ -18,9 +18,7 @@ const lessonDay = computed(() => localizedWeekdays[props.day])
const lessonDuration = computed(() => lessonTimes[props.time].join(''))
const lessonDate = computed(() => {
const currentDate = getCurrentDate()
currentDate.setDate(currentDate.getDate() - currentDate.getDay() + props.day + 1)
return localizeDate(currentDate)
return localizeDate(getWeekdays(getCurrentDate())[props.day])
})
const title = computed(() => (props.time ? `${props.time}. ura` : 'Predura'))
Expand Down

0 comments on commit 43559e9

Please sign in to comment.