Jeremy A
Jeremy A

Reputation: 141

Bootstrap-datepicker (eyecon.ro) => Option to limit year range

Just wondering if anyone had figured out a way to set an option to limit the year range for http://www.eyecon.ro/bootstrap-datepicker/ Bootstrap Datepicker plugin?

I want to limit the users ability to only select the current year, and really one a couple years into the future.

Upvotes: 0

Views: 1767

Answers (1)

Darrrrrren
Darrrrrren

Reputation: 6088

I believe there are startDate and endDate options for this plugin. At least, I am using them in an application I manage with eyecon.ro's datepicker extension.

So you could do something like:

$("#selecter").datepicker({

    startDate: '2012-11-02',
    endDate: '2014-12-31'
});

Additionally, I have code to do things like disable weekends - but that is a little more complex than a simple option set.

Upvotes: 6

Related Questions