The PXDBDateAndTime attribute and the PXDateAndTime attribute are designed to work with a DAC field of the Nullable<DateTime>
(DateTime?
) type and store both date and time value parts inside a single field:
#region UsrDateAndTime
public abstract class usrDateAndTimeAttribute : IBqlField
{ }
[PXDBDateAndTime(
DisplayNameDate = "Date Value Part",
DisplayNameTime = "Time Value Part")]
public DateTime? UsrDateAndTime { get; set; }
#endregion
From the UI perspective, for a field decorated with PXDBDateAndTimeAttribute or PXDateAndTimeAttribute, one is expected to create either separate input controls for date and time value parts:
<px:PXDateTimeEdit runat="server" ID="edUsrDate" DataField="UsrDateAndTime_Date" />
<px:PXDateTimeEdit runat="server" ID="edUsrTime" DataField="UsrDateAndTime_Time" TimeMode="True" />
or separate grid columns to enter and display date and time values:
<Columns>
...
<px:PXGridColumn DataField="UsrDateAndTime_Date" Width="90px" />
<px:PXGridColumn DataField="UsrDateAndTime_Time" Width="90px" TimeMode="True" />
...
</Columns>