Search and Top Navigation
#6866 closed bug (worksforme)
Opened January 15, 2011 08:56PM UTC
Closed January 15, 2011 10:15PM UTC
setDate adds or subtracts dates from today rather than parsing it correctly
Reported by: | adammw | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | ui.datepicker | Version: | 1.7.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
With the date format set to "yy-mm-dd", setting the date of the datepicker to anything will add or subtract relative to the current date rather than interpreting the absolute date. Removing the dateFormat to leave as default seems to have no effect
e.g. .datepicker('setDate','2001-01-01') ends up selecting 7th of July 2016 (because it is 2001-1-1 days away from today (16 Jan 2011))
.datepicker('setDate','1/1/2001') ends up selecting 11th of July 2016 (because it is 1+1+2001 days away from today (16 Jan 2011))
jsFiddle demo http://jsfiddle.net/AMjCh/