Skip to main content

Search and Top Navigation

#8510 closed bug (duplicate)

Opened August 20, 2012 05:56PM UTC

Closed August 20, 2012 05:58PM UTC

Last modified August 20, 2012 06:28PM UTC

parseDate() fails if no day in format

Reported by: lostapathy Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.datepicker Version: 1.8.23
Keywords: Cc:
Blocked by: Blocking:
Description

parseDate() fails for formats such as "MM yy" where no day is specified. This makes applications of the datepicker such as http://jsfiddle.net/timbuethe/PxGHV/ fail to parse the currently selected date correctly. That in turn always starts the picker at today's date rather than what was selected previously.

I suggest changing parseDate() to default the day to 1 in cases where the date format does not include a day rather, than than failing to parse, so that the datepicker can work for use cases such as this.

Attachments (0)
Change History (4)

Changed August 20, 2012 05:58PM UTC by scottgonzalez comment:1

resolution: → duplicate
status: newclosed

Not an exact duplicate, but it's the same rationale.

Changed August 20, 2012 05:59PM UTC by scottgonzalez comment:2

Duplicate of #7759.

Changed August 20, 2012 06:09PM UTC by lostapathy comment:3

I think this is a different issue than #7759. That ticket wants to pick a day/month without any year, which is indeed nothing like a meaningful date.

This ticket seeks to allow picking of month/year and assume the first of the month for the day. That yields a valid date, where as the other case is not.

Changed August 20, 2012 06:28PM UTC by scottgonzalez comment:4

The datepicker isn't intended to be used like this.