The PXTimeList attribute is designed to work with a DAC field of the Nullable<int>
(int?
) type and store time span value inside a DAC field as a number of minutes:
#region UsrTimeSpan
public abstract class usrTimeSpan : IBqlField
{ }
[PXDBInt]
[PXTimeList]
[PXUIField(DisplayName = "Time Span")]
public int? UsrTimeSpan { get; set; }
#endregion
In the UI, for a field decorated with PXTimeListAttribute the system creates a drop-down with 30-minute interval values both on a form:
<px:PXTimeSpan ID="edUsrTimeSpan" runat="server" DataField="UsrTimeSpan" InputMask="hh:mm" />
and within a grid cell:
<RowTemplate>
...
<px:PXTimeSpan ID="edgUsrTimeSpan" runat="server" DataField="UsrTimeSpan" InputMask="hh:mm" />
...
</RowTemplate>
<Columns>
...
<px:PXGridColumn DataField="UsrTimeSpan" Width="90px" RenderEditorText="True" />
...
</Columns>