Skip to content

Commit a07e1ad

Browse files
committed
Use the system's locale for the date picker first day of the week
1 parent a4cbe90 commit a07e1ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ui/Menus/DatePicker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export function promptForDate(
2626
enableTime: false, // Optional: Enable time picker
2727
dateFormat: 'Y-m-d', // Adjust the date and time format as needed
2828
locale: {
29-
firstDayOfWeek: 1, // Sets Monday as the first day of the week
29+
// Try to determine the first day of the week based on the locale, or use Monday
30+
// if unavailable
31+
firstDayOfWeek: (new Intl.Locale(navigator.language) as any).weekInfo.firstDay ?? 1,
3032
},
3133
onClose: async (selectedDates, _dateStr, instance) => {
3234
if (selectedDates.length > 0) {

0 commit comments

Comments
 (0)