Move Calendar display to Todays Date.

2 posts, 1 answers
  1. Merlin
    Merlin avatar
    15 posts
    Member since:
    Feb 2013

    Posted 25 Feb 2013 Link to this post


    I am using radcalendar for displaying the dates. I want to add a RadButton and On clicking the button, I want to navigate to today's date in the calendar. I want this to be done using client side code.

    Please help,Thanks,
  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Feb 2013 Link to this post

    Hello Merlin,

    Try the following JavaScript and attach it to the OnClientClicked event of the RadButton.

    <script type="text/javascript">
        function OnClientClicked(sender, args) {
            var today = new Date();
            var day = today.getDate();
            var month = today.getMonth() + 1;
            var year = today.getFullYear();
            var calendar = $find("<%=RadCalendar1.ClientID%>");
            var todaysdate = [year, month, day];

  3. DevCraft R3 2016 release webinar banner
Back to Top