longbill/jquery-date-range-picker

Disable past days

Closed this issue · 6 comments

How can I disable the user from selecting any past days. The user should be able to select any future dates just not be able to select any past dates.

+1

Idea: Introduce a parameter to define the relative start date. Possible values could be "0d"
for today, "-1d" for yesterday or "+1d" for tomorrow as start date.

+1

Wondering if anybody has found a way to do this with existing code?

Quick followup here. Here's what I did:
{
startDate: Date(),
}

I did not specify an endDate, and all seems to be ok. I had originally put something far in the future, but I don't believe it's needed in conjunction with startDate

@400Tryon thanks, that sounds like a good approach. Also check out the examples: http://longbill.github.io/jquery-date-range-picker/

Can someone explain this? Whenever i add "startDate: Date()," The calendar goes to undefined.

Hi @vedaleondesign. Please see the docs here: http://longbill.github.io/jquery-date-range-picker/.

This string defines the earliest date which is allowed for the user, same format as format

The value of startDate is supposed to be a String, with the format specified in the format option or false.