p:calendar show date correctly, but hour and minute display zero

Post Reply
caiquecardoso
Posts: 13
Joined: 07 Dec 2016, 13:37

25 Aug 2020, 21:17

Hi,

I'm using p:calendar to offer to user a opportunite to change date and hour using the pattern="dd/MM/yyyy HH:mm", the date is equal in dialog window, but the hour and minute is always zero. Could you help me?

Best Regards,

Carlos Cardoso

Melloware
Posts: 2291
Joined: 22 Apr 2013, 15:48

25 Aug 2020, 21:25

That means your java.util.Date is set for 00:00.

Are you loading it from JPA nad using Temporal.DATE instead of Temporal.TIMESTAMP? Date will always truncate to midnight 00:00.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 8.0.3 / PF Extensions 8.0.4

caiquecardoso
Posts: 13
Joined: 07 Dec 2016, 13:37

26 Aug 2020, 20:29

Hi,

My page code is:

<p:calendar id="startDateIdDlg"
value="#{planningDashboard.planningStartDate}" showOn="button"
pattern="dd/MM/yyyy HH:mm" navigator="true" required="true"
locale="#{messages['prefix_locate']}" yearRange="c-3:c+3">
</p:calendar>

and the planningStartDate came from PlanningDashboard class. I change it, but still not working, like this:

public Timestamp getPlanningStartDate() {
Timestamp timestamp = new Timestamp(planningStartDate.getTime());
return timestamp;
}

Any idea?

Regards

Carlos Cardoso

caiquecardoso
Posts: 13
Joined: 07 Dec 2016, 13:37

26 Aug 2020, 20:30

Hi,

How can I send a image for you?

Regards.

Carlos Cardoso

mert.sincan
Posts: 4579
Joined: 29 Jun 2013, 12:38

27 Aug 2020, 13:00

Hi,

This issue is not related to Atlantis Layout or Theme. Could you please create an issue in PrimeFaces forum?

Thanks a lot for your understanding!
Best Regards,

Post Reply

Return to “Atlantis - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest