Set RadDatePicker client-side Min/Max dates to to 30days from todays date?

6.7k views Asked by At

i am currently using RadDatePicker to select a date.
Using the client API, 1. I'd like to be able to set the the min date to less than 30 days of current date and 2. maxdate to two years from current date. Is there another way in the API to do this? Again this is all client-side JavaScript.

1

There are 1 answers

0
vladimir On

See RadDatePicker Client Object.

<script type="text/javascript">

    function SetDataRange(radDataPicker) {

        var now = new Date();

        radDataPicker.set_minDate(new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000));
        radDataPicker.set_maxDate(new Date(now.getFullYear() + 2, now.getMonth(), now.getDate()));

    }

</script>