0
votes

I'm writing a page for find some record in two different range of dates (dates' name: from1, to1 and from2, to2). In the form page I've used 4 datepicker input and they work fine, but I wonder if there are some config to control these dates like this:

from1 < to1 < from2 < to2

It's to prevent wrong input by users.

Thank you

1

1 Answers

0
votes

For Bootstrap-datepicker

<input type="text" data-provide="datepicker" data-date-start-date ="enter start date here" data-date-end-date="enter end date here">

For jquery-ui datepicker:

Use the minDate and maxDate options.

http://api.jqueryui.com/datepicker/#option-minDate

http://api.jqueryui.com/datepicker/#option-maxDate

You may also use the yearRange option to set the year range:

http://api.jqueryui.com/datepicker/#option-yearRange