wwilsman / Datepicker.js

Datepicker.js
http://wwilsman.github.io/Datepicker.js
MIT License
41 stars 20 forks source link

Default date #23

Open OZ1245 opened 2 months ago

OZ1245 commented 2 months ago

How does the "openOn" option work? I set the default date (not today) but it doesn't work.

My minimal code:

const datepicker = new Datepicker('#input', {
  inline: true,
  time: true,
  openOn: dayjs('24.03.1993 08:45', 'DD.MM.YYYY HH:mm').toDate() // convert Day.js object to Date object
})

But the datepicker is set to "today".

How set default date?

PS: I tried to set it inside onInit or onRender callbacks, but datepicker doesn't exist yet. So it doesn't work either...

OZ1245 commented 2 months ago

I forgot to mention that we are talking about the "inline" mode.