Search code examples
javascriptjquerydatepickerleap-year

Jquery datepicker showing wrong date for leap year


I am using a date-picker in an old project and it is working fine but it displayed wrong date for leap year for 29/02/2016.

This is displaying 01/03/2016 instead of 29/02/2016. Please help me for displaying proper date of leap year.

Visit: http://2008.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePicker.html


Solution

  • This bug was actually reported in this particular date-picker back in 2010. See issue #195. There's a workaround posted there - or rather a rewrite of one of the functions.

    However, it's clear that this library has been abandoned, so my recommendation would be to switch to something else. If your project is jQuery focused, try the date picker control in jQuery UI. If you don't like the overhead of jQueryUI, it's been made available separately here.