Bug Tracker

Ticket #2351 (closed bug: fixed)

Opened 7 years ago

Last modified 7 years ago

Datepicker - awkward handling of default date

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

Description

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

ui.datepicker.errors.html Download (1.1 KB) - added by adsmart 7 years ago.

Change History

Changed 7 years ago by adsmart

comment:1 Changed 7 years ago by paul

  • Owner changed from paul to iMarc

comment:2 Changed 7 years ago by kbwood

  • Owner changed from iMarc to kbwood

comment:3 Changed 7 years ago by kbwood

  • Status changed from new to closed
  • Resolution set to fixed

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.
Note: See TracTickets for help on using tickets.