This is a migrated thread and some comments may be shown as answers.

datepicker mindate 6 months from now

3 Answers 123 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 12 Jan 2009, 04:04 PM
Hello,

How can i set the mindate on my datepicker to 6 months from today or current date?

Thank you

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 12 Jan 2009, 05:13 PM
Hello Sroun,

A possible approach using client-side code would be:
<body> 
    <form id="form1" runat="server"
 
    <script language="javascript" type="text/javascript"
 
        function SetMinDate(sender, eventArgs) 
        { 
            var daysShift = 180
            var dayValue = 86400000
            var newnewDate = new Date(new Date().getTime() + (daysShift * dayValue)); 
            sender.set_minDate(newDate); 
        } 
         
    </script> 
 
    <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
        <telerik:RadDatePicker ID="RadDatePicker1" runat="server"
            <DateInput runat="server" ClientEvents-OnLoad="SetMinDate" /> 
        </telerik:RadDatePicker> 
    </div> 
    </form> 
</body> 

I hope this helps.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sean
Top achievements
Rank 1
answered on 12 Jan 2009, 05:28 PM
Thanks daniel.
I found a simpler way on the server side: using datetime.now.addmonth(-6);

By the way, you guys may fix your forum. each time i check my post it increases the view count. it may mislead the user about the actual number of people viewing the post.

Thank you
0
Daniel
Telerik team
answered on 12 Jan 2009, 05:57 PM
Hello Sroun,

I'm glad that you managed to achieve the desired functionality.

I would also like to thank you for the feedback about our forums. We highly appreciate the opinion of our customers.

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Sean
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Sean
Top achievements
Rank 1
Share this question
or