0

I am trying to restrict the dates in the date picker and would like to make available only for 2012 and 2013 in the date-picker. how would i do that? I am not sure the syntax of j-query so i can restrict it. thanks this is what i have so far. here is my j-query

   <script type="text/javascript">
             $(document).ready(function () {
                 $('.datepicker').datepicker({ minDate: -20, maxDate: "+1M +10D" });
             });
    </script>
2
  • api.jqueryui.com/datepicker/#option-maxDate <-- This link shows that "y" for years, "m" for months, "w" for weeks, and "d" for days Commented Nov 14, 2013 at 19:51
  • Oh I think I misunderstood your question.. You want those dates ranges for 2012 and 2013? Commented Nov 14, 2013 at 19:55

1 Answer 1

2

You should assign Date objects to the two fields:

$('.datepicker').datepicker({ minDate: new Date(2012, 0, 1) , maxDate: new Date(2013, 11, 31) });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.