Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#8510 closed bug (duplicate)

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.

Change History (4)

comment:1 Changed 8 years ago by Scott González

Resolution: duplicate
Status: newclosed

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

comment:2 Changed 8 years ago by Scott González

Duplicate of #7759.

comment:3 Changed 8 years ago by lostapathy

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.

comment:4 Changed 8 years ago by Scott González

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

Note: See TracTickets for help on using tickets.