uxsolutions / bootstrap-datepicker

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

Bootstrap datepicker not showing correct value? #2146

Open jackyef opened 7 years ago

jackyef commented 7 years ago

Expected behaviour

Tell us what should happen. This is what I do in one of my datepicker $('#date_of_purchase').datepicker('update', '2017-03-24');

Since I used the following format: format: 'DD, dd MM yyyy'

I expect the datepicker to show "Friday, 24 March 2017".

Instead, it shows "Friday, 07 September 29" (yes, the year 29, that wasn't a typo).

I used datepicker v1.6.4

Please help, thanks!

jackyef commented 7 years ago

Apparently, passing a date in the format of 'd-m-Y' ('24-03-2017') fixes it.

Is this the default behaviour of the datepicker, or does it change depend on what system we are viewing the webpage in? I need to know this information because I have to ensure that the date won't be problematic when viewed in other system.

Thanks!