Skip to main content

Search and Top Navigation

#2351 closed bug (fixed)

Opened February 15, 2008 09:10PM UTC

Closed February 21, 2008 05:25AM UTC

Last modified February 26, 2009 11:30AM UTC

Datepicker - awkward handling of default date

Reported by: adsmart Owned by: kbwood
Priority: major Milestone: 1.5
Component: ui.core Version: 1.2.3
Keywords: datepicker Cc:
Blocked by: Blocking:

I have noticed several issues with the way that dates are handled.

By default, when you attach the datepicker, it defaults to today. However, if you set the min date to be "+1d", the default date is still today. It seems to me that shouldn't be possible.

I also notice that when today is picked, only datepicker_currentDay is given to the cell, datepicker_today is missing. This is a mistake. The two properties are not mutually exclusive; I might want identify the current day by changing to border colour and today by changing the font colour.

Finally, if you activate the calendar with no value in the text field, and close it (but not cancel) without selecting a date no value is populated in the text field. This is unexpected, because the default date shows as selected. If I want the default date, I have a visual cue that it is already selected, I might then choose to close (or click elsewhere) because I think that date is already selected. My suggestion is that the default date can show the mouseOver state, or use a new classname. Using mouse over has the better behaviour that its clear the default value is not actually selected. Or make sure the date is populated in the text field on close.

I've attached an HTML file with a date picker showing the first issues. The last issue can be seen with the second datepicker where you can see the last effect, simply open then close the control.

Attachments (0)
Change History (5)

Changed February 19, 2008 12:32PM UTC by paul comment:1

owner: pauliMarc

Changed February 21, 2008 05:22AM UTC by kbwood comment:2

owner: iMarckbwood

Changed February 21, 2008 05:25AM UTC by kbwood comment:3

resolution: → fixed
status: newclosed

Thanks for the comments. I'll implement them as follows:

  • Default date is restricted to min/max date range.
  • currentDay and today styles are both applied.
  • Date only shows as selected in the field has a value, otherwise the default date takes on the daysCellOver style.

Changed May 24, 2008 03:39AM UTC by comment:4

milestone: 1.2.4

Milestone 1.2.4 deleted

Changed February 26, 2009 11:30AM UTC by paul comment:5

milestone: → 1.5