Time Picker EndTime

4 posts, 0 answers
  1. Arseni
    Arseni avatar
    4 posts
    Member since:
    Dec 2010

    Posted 20 Dec 2010 Link to this post

    Hi.
    I've two time pickers, one to enter a "start time" and another for the "end time". I set both with 00:30:00 interval. First one StartTime is 00:00:00 and EndTime is 23:30:00. Second one StarTime is 00:30:00 and EndTime must be 00:00:00 (or 24:00:00) but it doesn't work. If I try to set 23:59:59, due to Interval I can't see in the timetable this last one. How I can set and EndTime to 00:000:00 (or view 23:59:59 with 30 minutes Interval)  without change the day?

    Thanks in advance.
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 23 Dec 2010 Link to this post

    Hello Arseni,

    Please try setting the following in the Page_Load event:
    protected void Page_Load(object sender, EventArgs e)
        {
            RadTimePicker2.TimeView.StartTime = new TimeSpan(0, 0, 0, 0);
            RadTimePicker2.TimeView.EndTime = new TimeSpan(1, 0, 0, 1);
        }


    Kind regards,
    Maria Ilieva
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. TechSavvySam
    TechSavvySam avatar
    38 posts
    Member since:
    Jul 2009

    Posted 25 Aug 2011 Link to this post

    This "solution" doesn't really do what I want.  It is not possible for 12:00AM to exist twice in one day, which is kind of what your solution does.  What I want is to see times like this:

    12:00 AM
    12:30 AM
    ...
    11:30 PM
    11:59 PM

    instead, I see:

    12:00 AM
    12:30 AM
    ...
    11:30 PM

    I get that the moment right before midnight is a boundary exception, but your solution is technically incorrect (and confusing to users) as 12:00 AM can't exist twice in one day.  For example if I wanted to create a schedule that says I'm open all day Friday, I would say I'm open from

    Friday 12:00:00 AM to Friday 11:59:59 PM

    NOT:

    Friday 12:00:00 AM to Friday 12:00:00 AM (that would imply I'm open 0 seconds)

    Since I am specifying hours of operation by day of week and then a start time and end time, I can't specify Friday as the start day and Saturday as the end day.

    Your solution implies that there are 86,401 seconds in a day or 1,441 minutes in a day (depending on whether I use seconds or minutes granularity) which is not correct.
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 30 Aug 2011 Link to this post

    Hi Sam,

    The required functionality could not be achieved with RadTimePicker controls.
    Possible;e approach in this case is to not set any start and end time for the Timepicker like this:
    <telerik:RadTimePicker ID="RadDateTimePicker1" runat="server">
            <TimeView  TimeFormat="HH:mm:ss" Interval="00:30:00"
                Columns="12">
            </TimeView>
            <DateInput DateFormat="HH:mm:ss" DisplayDateFormat="HH:mm:ss">
            </DateInput>
    </telerik:RadTimePicker>


    Kind regards,
    Maria Ilieva
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top