Skip to content

Commit

Permalink
fix(core): fix broken week day names in datepicker
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfeldpausch committed Dec 1, 2023
1 parent c18a400 commit 35d8e12
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getFirstDayOfWeek(language: string): number {

function daysForLocale(language: string, weekday: 'long' | 'short' | 'narrow' = 'long') {
const date = new Date();
const firstDayOfWeek = date.getUTCDate() - date.getUTCDay();
const firstDayOfWeek = (date.getUTCDate() - date.getUTCDay() + 7) % 7;
const format = new Intl.DateTimeFormat(language, { weekday }).format;
return [...Array(7).keys()].map(day => format(date.setUTCDate(firstDayOfWeek + day)));
}
Expand Down

0 comments on commit 35d8e12

Please sign in to comment.