0

I am trying to limit what the users can select from the date-picker so i only need to let the user select the last 2 days. I also don't want them to select today's date and forward. how can i limit the selection for the date-picker only for the last 2 days and nothing else? thanks

<script type="text/javascript">
        $(document).ready(function () {
            $('.datepicker').datepicker({ minDate: -2 });
        });
    </script>
0

1 Answer 1

2

You can use maxDate option

$('.datepicker').datepicker({ minDate: -2, maxDate: -1 });

Example

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.