raddatepicker max date

4 posts, 0 answers
  1. cognos s
    cognos s avatar
    35 posts
    Member since:
    Oct 2009

    Posted 25 Nov 2009 Link to this post

    I am setting raddatepicker like this:
    raddatepicker.maxdate = datetime.today...but still its allowing me to select future dates in the popup calendar.
  2. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 25 Nov 2009 Link to this post

    Hello Cognos,

    I'm unable to reproduce the problem. Please try the following code-snippets and let me know what your findings are.
    protected void Page_Load(object sender, EventArgs e)
    {
        RadDatePicker1.MaxDate = DateTime.Now;
    }

    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" />

    Best regards,
    Daniel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    2 posts
    Member since:
    Aug 2015

    Posted 11 Aug 2015 in reply to Daniel Link to this post

    Hello Daniel,

    i try whit ur code-snippets and it works on local mode, but when i try it on other server (with UTC time) leave me to select future date and hours, how i can solve it?

    thanks!

  5. David
    David avatar
    2 posts
    Member since:
    Aug 2015

    Posted 11 Aug 2015 in reply to Daniel Link to this post

    i have the solution, sorry :)

    i just do this: 

    window.onload = function() {
       getDate();
    }
     
     
    function getDate() {
      var now = new Date();
      var datePicker = window.$find("<%=RadDateTimePicker.ClientID%>");
      datePickerInicio.set_maxDate(new Date(now.getFullYear(), now.getMonth(), now.getDate(),   
      now.getHours()));
    }

    this solve my problem :D

Back to Top