Today button in Calender

5 posts, 1 answers
  1. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 12 Jan 2010 Link to this post

    Hi, I am trying to have a "today" button in datepicker (and maybe in radcalnder as well)
    how would I archive this (at moment, to go to today, need to select month-today) 
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Jan 2010 Link to this post

    Hello James,

    I accomplished the same by placing button in FooterTemplate of Calendar in datepicker, then set the date in the click handler of button.

    ASPX:
     
        <telerik:RadDatePicker ID="RadDatePicker10" runat="server" Width="140px"
            <Calendar runat="server"
                <FooterTemplate> 
                    <div style="width: 100%; text-align: center; background-color: Gray;"
                        <input id="Button1" type="button" value="Today" onclick="GoToToday()" /> 
                    </div> 
                </FooterTemplate> 
            </Calendar> 
        </telerik:RadDatePicker> 

    JavaScript:
     
        function GoToToday() { 
            var datepicker = $find("<%=RadDatePicker10.ClientID%>"); 
            var dt = new Date(); 
            datepicker.set_selectedDate(dt); 
        } 

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 24 Jan 2010 Link to this post

    works great! thank you for the tip
  5. Michael Veltre
    Michael Veltre avatar
    2 posts
    Member since:
    Sep 2009

    Posted 06 Oct 2014 in reply to Shinu Link to this post

    How can I accomplish the same function server side?
  6. Eyup
    Admin
    Eyup avatar
    3007 posts

    Posted 09 Oct 2014 Link to this post

    Hi Michael,

    You can use the SpecialDays collection to achieve this requirement:
    http://demos.telerik.com/aspnet-ajax/calendar/examples/functionality/today/defaultcs.aspx

    Hope this helps.

    Regards,
    Eyup
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017