This is a migrated thread and some comments may be shown as answers.

Time Picker EndTime

3 Answers 115 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Arseni
Top achievements
Rank 1
Arseni asked on 20 Dec 2010, 10:59 AM
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.

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 23 Dec 2010, 10:34 AM
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.
0
TechSavvySam
Top achievements
Rank 1
answered on 25 Aug 2011, 08:13 PM
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.
0
Maria Ilieva
Telerik team
answered on 30 Aug 2011, 02:26 PM
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 >>

Tags
Calendar
Asked by
Arseni
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
TechSavvySam
Top achievements
Rank 1
Share this question
or