Closed santuparashetti closed 6 years ago
There is no support for changing anything after initialization. If you need something like this you'd better destroy the instance and initialize it once again. Alternatively, you can try to modify internal state, but there is no guarantee it'll work in next versions of the library and you might encounter parsing or other issues with existing dates, so be extra careful.
Much better idea depending on use case would be to listen to change event and format date as you like manually.
Thanks @nazar-pc, I think as you suggested in the first option, will destroy the instance and initialize it again is the best solution for my use-case. 👍
Not able to change date format after its initialization dynamically. But I can set format while init and its working fine.
my code is like this:
const value = 'd-m-Y'
(this value comes from user selection)const comp =$(parentDiv).find('input#pickmeupDate')
pickmeup(comp[0], { format: value })
Am I missing anything or is there any other syntax?