TimeSpanEdit with hour-values greater than 24?
Hi,
does anyone know a way to get the TimeSpanEdit accepting inputs for hours greater than 24?
Use case:A testbench is calculating idle times (in minutes) which are assigned to a cause manually. E.g. 31:25 (hours:minutes) for case "user absent".
The standard behaviour of the control when you enter 31 hours is to show the difference to 24. For example if you enter 31 hours and the controls will show 7. (31-24).
To enter the day like 1.07:25 is not an option.
Thanks in adavnce for your suggestions!
Best regards!
Martin
SIGN IN To post a reply.
4 Replies
KP
Kanniyappan Panneer Selvam
Syncfusion Team
January 14, 2020 07:37 AM UTC
Hi Martin Hagenow
Thanks for contacting Syncfusion support.
We are currently validating your query and updating the further details on 20th January 2020.
We are currently validating your query and updating the further details on 20th January 2020.
We appreciate your patience until then.
Regards,
Kanniyappan P
NI
Ninja
Syncfusion Team
January 20, 2020 01:49 PM UTC
Hi Martin,
We have checked your query “ Need to get the TimeSpanEdit accepting inputs for hours greater than 24”. We have created a work around solution to meet your criteria when the format is “hh:mm:ss”. Please refer the below sample and code snippet for same. This solution works properly for hour format alone (i.e . when format contains day and when you enter 48 value in hours, the day value will not update). Please let us know if the provided solution has satisfied your criteria.
XAML:
<syncfusion:TimeSpanEdit Grid.Row="0" Name="myTimeSpanEdit" Height="23" Width="180" Format="hh:mm:ss" Value="12:10:25" ValueChanged="myTimeSpanEdit_ValueChanged" > </syncfusion:TimeSpanEdit> |
C#:
private void myTimeSpanEdit_ValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e){if ((int)TimeSpan.Parse(e.NewValue.ToString()).TotalHours > 24){int hour = (int)TimeSpan.Parse(e.NewValue.ToString()).TotalHours % 24;(d as TimeSpanEdit).Value = new TimeSpan(hour, (d as TimeSpanEdit).Value.Value.Minutes, (d as TimeSpanEdit).Value.Value.Seconds);}} |
Sample link: https://www.syncfusion.com/downloads/support/forum/150593/ze/CS1370601099
Regards,
Niranjan Kumar
MH
Martin Hagenow
January 21, 2020 09:51 AM UTC
Perfect!
Many Thanks!
Regards,
Martin
NI
Ninja
Syncfusion Team
January 21, 2020 03:30 PM UTC
Hi Martin,
Thanks for your update.
Please let us know if you have further queries. We will be happy to assist you.
Regards,
Niranjan Kumar
SIGN IN To post a reply.
- 4 Replies
- 3 Participants
-
MH Martin Hagenow
- Jan 13, 2020 08:04 AM UTC
- Jan 21, 2020 03:30 PM UTC