You can enter a time span directly in the TimeSpanInputBox using:
- 'y' for years
- 'm' for months
- 'w' for weeks
- 'd' for days
- 'hrs' for hours
- 'min' for minutes
- 'sec' for seconds
- A combination of these units, with the units listed in the order given
You can optionally include spaces between the different time elements. For example,
you could enter:
- 2y23d14hrs7min, or
- 2y 23d 14hrs 7min
The TimeSpanInputBox is initialized with the following code:
<NhsCui:TimeSpanInputBox ID="TimeSpanInputBox1" runat="server" />
- From – the wrapper for Value.From
- Granularity – the wrapper for Value.Granularity
- IsAge – the wrapper for Value.IsAge
- Threshold – the wrapper for Value.Threshold
- To – the wrapper for Value.To
- Value – gets or sets the time span entered in the input box
- UnitLength – specifies whether long or short units are used
If a duration control is combined with either date and/or time controls, the values
expressed within the duration control will be dependent on the date/time controls
combined with the duration control, as follows:
- Duration and Time Control = hrs, min and sec
- Duration and Date Control = y, m and d
- Duration and Date and Time = y, m, d, hrs, min and sec
The clinical application needs to allow:
- The entry of different durations either independently or using combinations
- Editing of the individual elements of the durations entered into the control
- The duration to be automatically calculated when a start date/time and an end date/time
are entered
- The end date/time to be automatically calculated when a start date/time and duration
(or vice versa) are entered
- The use of y for years, m for months, d for days, hrs for hours, min for minutes
and sec for seconds
If IsAge is:
- “True”, the Granularity and Threshold property values are set from the
time span
- “False”, the Granularity and Threshold property values are set from
the assigned Granularity and Threshold property values
The following table provides guidance on how the Granularity and Threshold
values are set from the time span.  
|
Time span
|
Granularity
|
Threshold
|
|
Less than 2 hours
|
Minutes (TimeSpanUnits.Minutes)
|
Minutes (TimeSpanUnits.Minutes)
|
|
Less than 2 days
|
Hours (TimeSpanUnits.Hours)
|
Hours (TimeSpanUnits.Hours)
|
|
Less than 4 weeks
|
Days (TimeSpanUnits.Days)
|
Days (TimeSpanUnits.Days)
|
|
Less than 1 year
|
Weeks (TimeSpanUnits.Weeks)
|
Days (TimeSpanUnits.Days)
|
|
Less than 2 years
|
Months (TimeSpanUnits.Months)
|
Days (TimeSpanUnits.Days)
|
|
Less than 18 years
|
Years (TimeSpanUnits.Years)
|
Months (TimeSpanUnits.Months)
|
|
Greater than or equal to 18 years
|
Years (TimeSpanUnits.Years)
|
Years (TimeSpanUnits.Years)
|
- UnitLength has a default value of "Short". If long units are specified using "Long",
the entire unit name is included. If short units are specified, an abbreviated form
of the unit is included. Singular or plural versions of the units are included automatically.