set_startTime doesn't change set the start time of the TimeView

2 posts, 0 answers
  1. Allen
    Allen avatar
    111 posts
    Member since:
    Apr 2012

    Posted 20 Mar 2013 Link to this post

    I'm creating a simple test program and use the set_startTime method, it doesn't work. It should start from 6:am (I hard code it).
    Please refer to the attached png

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script type="text/javascript">
    function OnPopupOpening(sender, args) {
    var MDate = sender.get_minDate();
    sender.set_minDate(2013 + '-' + 3 + '-' + 13 + '-' + 6 + '-' + 00 + '-' + 0 + '-' + 0);
    var MDateAfter = sender.get_minDate();
    var TWStartTime = sender._timeView.get_startTime();
    sender._timeView.set_startTime(6 + '-' + 00 + '-' + 0 + '-0-0');
    var TWStartTimeAfter = sender._timeView.get_startTime();
    var picker = $find("<%= RadDateTimePicker2.ClientID %>");
    var timeview = sender.get_timeView();
    var NDate = new Date(2013, 2, 13, 6, 0, 0, 0);
    $telerik.toTimeView(timeview).set_startTime(NDate);
    var TWStartTimeAfter = sender._timeView.get_startTime();
    }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">
    <title></title>
    </head>
    <body>
    <form id="form1" runat="server">

    <div>

    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>

    <telerik:RadDateTimePicker ID="RadDateTimePicker1" Runat="server"
    Culture="en-US"
    HiddenInputTitleAttibute="Visually hidden input created for functionality purposes."
    WrapperTableSummary="Table holding date picker control for selection of dates.">
    <TimeView CellSpacing="-1" interval="00:30:00"></TimeView>

    <TimePopupButton ImageUrl="" HoverImageUrl=""></TimePopupButton>

    <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>

    <DateInput DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" LabelWidth="40%"></DateInput>

    <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
    </telerik:RadDateTimePicker>

    </div>
    <div>

    <telerik:RadDateTimePicker ID="RadDateTimePicker2" Runat="server"
    Culture="en-US"
    HiddenInputTitleAttibute="Visually hidden input created for functionality purposes."
    WrapperTableSummary="Table holding date picker control for selection of dates.">
    <TimeView CellSpacing="-1" interval="00:30:00"></TimeView>

    <TimePopupButton ImageUrl="" HoverImageUrl=""></TimePopupButton>

    <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>

    <DateInput DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" LabelWidth="40%"></DateInput>

    <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
    <ClientEvents OnPopupOpening="OnPopupOpening" />
    </telerik:RadDateTimePicker>

    </div>
    <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton">
    </telerik:RadButton>
    </form>
    </body>
    </html>

  2. Angel Petrov
    Admin
    Angel Petrov avatar
    1006 posts

    Posted 25 Mar 2013 Link to this post

    Hi Allen,

    After testing for some time the issue proved to be a bug in the current implementation of the calendar. It is now logged into our system and you can monitor it's progress from here. Our developers will do their best to resolve the matter as soon as possible. For now you will have to set the start time server-side:
    Sub Page_Load(ByVal Sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
           Dim time As TimeSpan = New TimeSpan(6, 0, 0)
           RadDateTimePicker1.TimeView.StartTime = time
       End Sub

    Thank you for being so observant and for reporting this issue. As a token of gratitude I have updated you Telerik points.

    Kind regards,
    Angel Petrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top