how to set datepicker date after update input val


Topic: how to set datepicker date after update input val

mar1 asked 6 years ago

After update input val $('#date').val("2019-01-22") datepicker shoving today or old clicked date. how to change date in datepicker after input val updated ?


mar1 answered 6 years ago

i update input val in this way:

$('#date').pickadate('picker').set('select', "2019-01-02");

Mikołaj Smoleński staff commented 6 years ago

It's working great!

Thanks for Your help mar1.

Best regards


Mikołaj Smoleński staff answered 6 years ago

Unfortunately You can't update the datepicker value programatically.

Best regards


gianlucagiacometti pro premium priority answered 6 years ago

This feature should be a "must". At least please introduce the possibility to destroy the datepicker and re-attach it. Otherwise this thing is completely useless.


gianlucagiacometti pro premium priority answered 6 years ago

As it stands currently, according to the previous discussion, the only chance you have is to strip away the input tag, re-add it and every time you re-add it you re-attach the pickadate()
It works for me also in modals. I strip it away on hide and re-add it after show the modal. Hope this helps


Mikołaj Smoleński staff answered 6 years ago

Hello Gianluca,

Thank you for your tips. They will be very helpful for us.

Best regards


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.15
  • Device: laptop
  • Browser: firefox
  • OS: win10
  • Provided sample code: No
  • Provided link: No
Tags