hmahdavi
hmahdavi

Reputation: 2354

Boostrap datepicker does not display years with min date and yearRange options

I want run Boostrap datepicker with mindate and year range but there is a problem with these options.When run the following code year range not display.

How to solve this?

 $(datePiker).datepicker({
                    dateFormat: "yy/mm/dd",
                    changeMonth: true,
                    changeYear: true,
                    yearRange: "-100:-13",
                    defaultDate: "-13y",
                    minDate: 5,
                });

enter image description here

Upvotes: 1

Views: 60

Answers (2)

hmahdavi
hmahdavi

Reputation: 2354

I set exactly yearRange and defaultDate then solved.

$(datePiker).datepicker({
                dateFormat: "yy/mm/dd",
                changeMonth: true,
                changeYear: true,
                yearRange: "2000/01/01:2010/01/01",
                defaultDate: "2000/01/01",
                minDate: 5,
            });

Upvotes: 0

Ahmed Shamel
Ahmed Shamel

Reputation: 1962

First, I think there is a problem with the dateFormat. Also, instead of minDate use startDate

See this website, it may help you.

Upvotes: 1

Related Questions