Page 1 of 1

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

Posted: 25 Aug 2020, 21:17
by caiquecardoso
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

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

Posted: 25 Aug 2020, 21:25
by Melloware
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.

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

Posted: 26 Aug 2020, 20:29
by caiquecardoso
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

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

Posted: 26 Aug 2020, 20:30
by caiquecardoso
Hi,

How can I send a image for you?

Regards.

Carlos Cardoso

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

Posted: 27 Aug 2020, 13:00
by mert.sincan
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,