Skip to main content
Solved

How to enter Hours/Minutes for Custom field of type DateTime?


nhatnghetinh
Captain II
Forum|alt.badge.img+9

Dear Team,

I want to create a new Custom field of type DateTime that can input Date and Hours/Minutes.

 

 

Please help me the solution !

 

Best Regards,

NNT

Best answer by aaghaei

If you are using form then have a loot at the below

 

<px:PXTimeSpan DataField="Time" runat="server" ID="edtime" SummaryMode="true" InputMask="hh:mm" Width="100" ></px:PXTimeSpan>

 

If you are using grid then add from the data fields and it should come something like 

 

<px:PXGridColumn DataField="Date_Time" CommitChanges="true" ></px:PXGridColumn>

View original
Did this topic help you find an answer to your question?

aaghaei
Captain II
Forum|alt.badge.img+9
  • Captain II
  • December 4, 2023

public abstract class date : PX.Data.BQL.BqlDateTime.Field<date> { }[PXDBDateAndTime(DisplayNameDate = "Date", DisplayNameTime = "Time", UseTimeZone = true)]
[PXUIField(DisplayName = "Date")]

public virtual DateTime? Date { get; set; }


nhatnghetinh
Captain II
Forum|alt.badge.img+9

Hi @aaghaei,

I have performed customization as you instructed but the results only display the Date. Cannot enter Time.

 

Best Regards,

NNT


aaghaei
Captain II
Forum|alt.badge.img+9
  • Captain II
  • December 4, 2023

If you are using form then have a loot at the below

 

<px:PXTimeSpan DataField="Time" runat="server" ID="edtime" SummaryMode="true" InputMask="hh:mm" Width="100" ></px:PXTimeSpan>

 

If you are using grid then add from the data fields and it should come something like 

 

<px:PXGridColumn DataField="Date_Time" CommitChanges="true" ></px:PXGridColumn>


aaghaei
Captain II
Forum|alt.badge.img+9
  • Captain II
  • December 4, 2023

A friendly advise. I underestand people like to be productive and get the things done but always is a good idea to read through the materials or watch the videos to learn doing the work the right way. I bet you would get answer for all your questions in the materials.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings