uxsolutions / bootstrap-datepicker

A datepicker for twitter bootstrap (@twbs)
Apache License 2.0
12.68k stars 6.06k forks source link

Update the calendar when used the 'update' function #2614

Open gui-rocha opened 3 years ago

gui-rocha commented 3 years ago

Expected behaviour

Update the calendar when used the 'update' function

Actual behaviour

Different values ​when use 'update' function, the calendar value is different between clicking the icon and the input.

Datepicker version used

1.9.0

Example code

In demo online of bootstrap-datepicker can reproduced this problem. When I use the code bellow, in the console dev tools, don't update the calendar in the icon click.

$("#sandbox-container input").datepicker("update", "08/05/2021");

Image when I click in the input:

Image when I click in the input

Image when I click in the icon:

Image when I click in the icon

jcDu commented 3 years ago

I meet the same problem, any update?

lukexp commented 3 years ago

I found a partial solution to update the value in the calendar.

$('.datepicker').val( '08/05/2021').trigger('keyup');