search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

DatePicker popup - 2 questions

Asked by Julien
1 day ago.

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

I use this as a base example:
https://javascript.daypilot.org/demo/calendar/datepicker.html

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.

Thanks in advance!

Answer posted by Dan Letecky [DayPilot]
13 hours ago.
  1. The DayPilot.DatePicker class is now included in the TypeScript definitions in the latest sandbox build (2025.3.6620). Thanks for reporting the problem.

  2. 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
11 hours ago.
  1. Excellent, thank you!

  2. 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.

New Reply
This reply is
Attachments:
or drop files here
Your name (optional):