Skip to content

Commit 3a34bab

Browse files
committed
refactor: Extract variable weekInfo
1 parent 6133316 commit 3a34bab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ui/Menus/DatePicker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export function promptForDate(
2222
// running overnight, the flatpickr modal shows the previous day as Today.
2323
// Try to determine the first day of the week based on the locale, or use Monday
2424
// if unavailable
25-
const firstDayOfWeekFromLocale = (new Intl.Locale(navigator.language) as any).weekInfo.firstDay;
25+
const weekInfo = (new Intl.Locale(navigator.language) as any).weekInfo;
26+
const firstDayOfWeekFromLocale = weekInfo.firstDay;
2627
const firstDayOfWeek = firstDayOfWeekFromLocale ?? 1;
2728
const fp = flatpickr(parentElement, {
2829
defaultDate: currentValue ? currentValue.format('YYYY-MM-DD') : new Date(),

0 commit comments

Comments
 (0)