Skip to content

Commit

Permalink
fix for empty lang enums
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaudiomv committed Jun 3, 2024
1 parent fed112f commit 8227612
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/DataUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function prepareSimpleLine(meeting: Meeting, withDate: boolean = true): string {
// January 1, 2023, was a Sunday.
const baseDate = new Date('2023-01-01');
baseDate.setDate(baseDate.getDate() + adjustedDay);
const lang = meeting.lang_enum === 'dk' ? 'da' : meeting.lang_enum;
const lang = meeting.lang_enum ? (meeting.lang_enum === 'dk' ? 'da' : meeting.lang_enum) : window.navigator.language;
const twelveHrLangs: string[] = ['en', 'es'];
if (dayOfWeekInt && withDate) {
let dateString = baseDate.toLocaleDateString(lang, { weekday: 'long' });
Expand Down

0 comments on commit 8227612

Please sign in to comment.