Date and Time: Reference Information
In the tables of this topic, you can find reference information about date and time controls.
Conversion from ASPX to HTML and TypeScript
The following tables will help you to convert ASPX elements that are related to date and time controls to HTML or TypeScript elements.
ASPX | HTML or TypeScript |
---|---|
PXDateTimeEdit
|
To display two separate boxes for date and time, in the TypeScript code of the form, define two fields—a field for the date and a field for the time—as shown in the following code.
In HTML code of the form, use the
field tag for the date field
and a nested qp-field tag for the time field, as the following
code shows.
|
CommitChanges
|
Use the CommitChanges option of
PXFieldState in TypeScript, as the following code shows. With
this option, the control commits changes to the server each time a user has changed
the value in the box and focus is no longer on the
box.
|
DataField
|
To specify the data fields to be used for the date and time control, use the
name attribute of the field tag for the date
field, and control-state.bind of the qp-field
tag for the time field, as the following code
shows.
|
ID
|
Use the id attribute of the nested qp-field
tag for the time field, as the following code shows. The id
attribute is not used for field
tags.
|
SuppressLabel
|
To hide the label for a field, use class="no-label" for the
field, as the following code shows. For details about the class, see Form Layout: CSS Classes.
|
TimeMode
|
To indicate that the field contains time, use the timeMode
property of config of the field, as shown in the following
code.
|
Width
|
Use the col-N class to define the width of the field, as the
following code shows. In col-N, N is the number of columns
the field occupies, which can be a whole number between 1 and 12. For details about
the class, see Form Layout: CSS Classes.
|
ASPX Control | Property |
---|---|
PXDateTimeEdit | runat |
qp-datetime-edit and qp-datetime-edit-utc
The following table lists the properties that are available in the config property of the qp-datetime-edit and qp-datetime-edit-utc controls. The qp-datetime-edit-utc control displays the UTC date and time. The qp-datetime-edit control displays any date and time.
Property | Description |
---|---|
allowCustomItems | If the value is true, indicates that a user can specify custom values in the control. |
allowNull | If the value is true, indicates that an empty value is possible for the control. |
displayMask | Specifies the display mask for the control. |
durationMode | If the value is true, indicates that the field contains duration intervals. |
editMask | Specifies the edit mask for the control. |
firstDayOfWeek | Specifies the first day of the week. The days of the week are defined with numbers from 0 to 6, where 0 is Sunday, and 6 is Saturday. |
fullDOW | If the value is true, indicates that full names should be displayed for the days of week. |
fullMonth | If the value is true, indicates that full names should be displayed for months. |
height | Specifies the height of the control. Generally, you do not need to specify this property. |
maxValue | Specifies the maximum value that is available in the control. |
minValue | Specifies the minimum value that is available in the control. |
nullText | Specifies the value that is displayed if the value in the control is NULL. |
preserveTimezone | Indicates whether the system should keep the time zone for the date and time. If the value is false, the system converts the date and time to UTC. |
timeMode | Indicates (if the value is true) that the field contains time. The
following code uses this
property.
|
width | Specifies the width of the control. Generally you do not need to specify this property. Use the col-N class instead. For details about the class, see Form Layout: CSS Classes. |