RE: How can I set the time in Liferay Objects

thumbnail
Jamie Sammons, modified 2 Years ago. New Member Posts: 18 Join Date: 8/3/22 Recent Posts

Hello guys :)

I'm on Liferay 7.4u55, working with objects.
I created an object, added a field of type "date", I created a form. Now it seems to me, that the input is of type "date", without possibility to set a time. (added 2 images img1 & img2 of form-builder and 1 form container img3)

This date becomes a DATETIME in the database (img4), with a time value of 00:00:00.000000 which gets displayed as 12:00 AM, which does not look nice (img5).

This brings me to two questions:
How can I set a time in my objects, is there a possibility?
How can I hide the time in the frontend?

Best Regards
Adrian

img1 (Date input with reference)



img2 (datetime input without reference)


img3 (form container without datetime possibility)


img4 (database DATETIME)


img5(display with stupid 12 AM time)

 

thumbnail
Jamie Sammons, modified 2 Years ago. New Member Posts: 18 Join Date: 8/3/22 Recent Posts

My own findings:

At this point its not possible to set the Time, there already is an issue: https://issues.liferay.com/browse/LPS-143068

For not displaying the time I came up with a workaround, not sure if there is a better approach:
I added following CSS to the div that displays the time

.dateDiv{ 
  width: 8ch; //8characters wide, bcs 00/00/00
  height: 1rem;
  overflow: hidden;
}

Greetings