TangibleInc / template-system

A template system for WordPress with content type loops and conditions
https://docs.loopsandlogic.com/reference/template-system/
8 stars 3 forks source link

`acf_time` field ignores selected format and displays the current date #84

Closed BenTangible closed 7 months ago

BenTangible commented 8 months ago

This issue is likely closely related to this other issue that was addressed a couple weeks back and comes from the same forum thread. It seems that by default, <Field acf_time=time_field_name /> displays today's date instead of the time from the ACF field. I'm able to manually correct this by specifying a format with <Field acf_time=time_field format="g:i a" />.

Edit: just did another test and confirmed that this is also the case for the acf_date_time field. It seems we should just do a thorough test of all the ACF date/time/datetime fields and ensure that without attributes they display the format defined in the ACF settings. We should also release this since it seems silly to be sitting on a bug fix for weeks without releasing it.

eliot-akira commented 7 months ago

This has been solved by https://github.com/TangibleInc/template-system/commit/844422f32cc1c060e64a3d0111b444b2651d9c13.

ACF Date/Time and Time field: Use the same default format as how ACF saves field value in the database

  • Date/Time: "Y-m-d H:i:s"
  • Time: "H:i:s"