When I click a button, I want to open a DatePicker popup in order to select the date to display in a Calendar configured with:
- selectMode: 'Week'
- weekStarts: 1
Question #1
I use DayPilot Pro Javascript using Typescript (npm package). It seems the “DayPilot.DatePicker“ type is missing? I have to use: “new (DayPilot as any).DatePicker(…)“ (I may declare the types myself, but I think the type should be available in the package?)
Question #2
Is there a way for that DatePicker popup to start the weeks on mondays, like my Calendar? I tried adding “weekStarts: 1“ in the options, but without success. It’s very odd to have a date picker that doesn’t start the weeks on the same day as the target Calendar.
Answer posted by Dan Letecky [DayPilot] 1 years ago.
The DayPilot.DatePicker class is now included in the TypeScript definitions in the latest sandbox build (2025.3.6620). Thanks for reporting the problem.
To set a custom first day of the week, use the locale property, which also controls other culture-specific settings. The default value is "en-us", which uses Sunday as the first day of the week. You can use one of the predefined locales or create and register a new one.
Comment posted by Julien 1 years ago.
Excellent, thank you!
I still think the “weekStarts“ option should exist on the DayPilot.DatePicker component since it exists on the DayPilot.Navigator('datepicker') one, for example. But using a custom locale is indeed a workaround.
Thank for the help.
Comment posted by Dan Letecky [DayPilot] 1 years ago.
The weekStarts property is now available as well (build 2025.3.6622).
Comment posted by Julien 1 years ago.
Thanks for listening to suggestions!
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.