Bug Tracker

Modify

Ticket #2061 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

if minDate is set to new Date, today is not selectable

Reported by: wortho Owned by: iMarc
Priority: minor Milestone: 1.2.2
Component: ui Version: 1.2.1
Keywords: datepicker Cc:
Blocking: Blocked by:

Description

The documentation says that minDate should be the minimum date the user can select as a date, however, the behaviour is that all dates including the minDate is greyed out.

Either the documentation needs changing or minDate should be the last ALLOWED date for the user to click on.

In my opinion it should be the latter, because people can then easily use new Date() for today instead of writing a function to calculate yesterday.

Change History

comment:1 Changed 5 years ago by paul

  • Owner set to iMarc

comment:2 Changed 5 years ago by kbwood

The minDate value must not have time values in it as this prevents it working correctly. So, for today, use: var today = new Date(); today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); $('???').datepicker({minDate: today});

I'll see if I can enforce this within the code.

comment:3 Changed 5 years ago by kbwood

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

Update code to remove time components of min/max dates before use.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.