Gurami
Gurami

Reputation: 15

multi datepicker to get dates from input field?

so my problem is this. I use the multi datepicker, http://multidatespickr.sourceforge.net/

for a site with news block. i save multiple dates for 1 news item and it works like a charm with php. BUT now my problem is, if someone wants to edit the news , I do get the current dates the news has, in a input field, but that isn't marked on the multi datepicker. problem here is, if they selected 30 dates, and want to exclude one after editing, they have to pick 29 dates again on datepicker, cause they wouldn't be active otherwise. my question here is, is there any way to make the datepicker get the dates from an input field ? FYI I get the same date formats both on getting and selecting from datepicker.

Upvotes: 1

Views: 1497

Answers (1)

vogomatix
vogomatix

Reputation: 5093

You'll have to show the context in which you use it, but the addDates parameter looks like it does what you want, so on instantiation you would pick up the list of dates from your input field and supply them in this parameter. See also how to pre-select dates.

I'm surprised the datepicker isn't permanently alive and just shows itself, in which case it would know what state it was in from last time it was hidden.

Update: reading even further it seems it uses the dates from an input field anyway. See this demo further in the instructions

Upvotes: 1

Related Questions