Q:

How to create only Time field control, no Date

I want to create a time field which displays and allows user to select only Time. I have tried setting it some properties (TimeMode=True, DisplayFormat=hh:mm, EditFormat=hh:mm) but while the format remains as hh:mm but dropdown still has default date in it (see below screenshots).

Please suggest.

A:

I have used some time only datetime fields... here is a quick sample:
On your DAC field, set it to use the PXDBTime attribute type as shown below...
[PXDBTime(DisplayMask = "t", UseTimeZone = false)]
[PXUIField(DisplayName = "My Time")]
public virtual DateTime? MyTime
{
    get { return this._MyTime; }
    set { this._MyTime = value; }
}

In your page, use the following...
<px:PXDateTimeEdit ID="edMyTime" runat="server" DataField="MyTime" DisplayFormat="t" EditFormat="t" TimeMode="True" SuppressLabel="True"/>

