Skip to content

Commit

Permalink
fix: week number not correct in some countries
Browse files Browse the repository at this point in the history
fix #1070
  • Loading branch information
marksie1988 committed Oct 5, 2023
1 parent ba384f1 commit 6d1b736
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/eventMode.html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ export function getLocationHTML(config: atomicCardConfig, event: EventClass) {
*/
export function getWeekNumberHTML(day: [EventClass], currentWeek: number) {
let currentWeekHTML = html``
if (currentWeek != day[0].startDateTime.week()) {
if (currentWeek != day[0].startDateTime.isoWeek()) {
if (day[0].startDateTime.isBefore(dayjs())) {
currentWeek = dayjs().week()
currentWeek = dayjs().isoWeek()
} else {
currentWeek = day[0].startDateTime.week();
currentWeek = day[0].startDateTime.isoWeek();
}

currentWeekHTML = html`<div class="week-number">${localize('ui.common.week')} ${currentWeek.toString()}</div>`
Expand Down

0 comments on commit 6d1b736

Please sign in to comment.