Different date display when logged out

We have a Dutch website. When the user (admin) is logged in, the date display’s correct, in Dutch. But, the visitors who are not logged in, see the date in English. (See also screenshot). This should be in Dutch also.
The Date is displayed by a ACF date field (datepicker)

 <Field acf_date=periode_van /> 
                  <If acf_true_false=periode_tot> t/m <Field acf_date=periode_tot /><Else /><!-- empty --></If>

Can you help me solve this?

Hi @Buzzard

Maybe you could try adding locale in your ACF Date Field? Here is the documentation that you can follow.

@Buzzard just chiming in to let you know that @ghen and I did a bit of testing and confirmed that this is a bug. It’s been reported here.

Hi Benjamin,

Thanks for your reply and for looking into it.
I will watch the tread to keep updated.

Hi Benjamin,
Is there perhaps any progress in this issue?

Unfortunately, there are a lot of ongoing bug fixes and feature implementation at the moment and I don’t have great visibility into the prioritization and timeline. Our lead developer has confirmed the bug and the intended behavior seems clear, so we’ll just have to be patient for this fix to get implemented. Sorry that I can’t provide any more specifics on this! I’m sure you’ll understand that given that it’s a free plugin, we have to be strategic about where/when/how we invest time and money into its development. Development seems to be quite active right now so I can’t imagine it’ll be too much longer.

@Buzzard, this commit was made a couple of hours ago so it looks like this issue should be resolved in the next release :smile:

1 Like

Hi Benjamin,

Thank you, that is great news.

@benjamin I just ran into the same problem.

:information_source: And furthermore it seems as if acf_time is not working at all. It just renders the date of today in the frontend (in English) instead of the time set in the ACF time picker in the backend. Can’t find a workaround …

The date set in an ACF date picker field can’t be formatted at the moment, as you already said above and in the github thread. Something like this line in the documentation is currently not working:

<Field acf_date=field_name format="l j F Y" locale=fr />

But formatting with the format tag is working:

<Format date="j. F Y" locale=de><Field acf_date="termin_datum" /></Format>

Do you know how long it will take until this will be resolved?

All the best, Daniel

Yeah I noticed that as well and reported it to the dev and that also seems to have been resolved. I’m not sure what the timeline is as far as when the next L&L release will be since I think there are a few additional things being worked on for the next release.

That being said, you can always download the latest version of the template system module directly from Github (direct download link) and install it just like a normal plugin alongside L&L to get these fixes before they’re bundled into an L&L release.

Thank you for letting me know! I read that you noticed the wrong behaviour of the format tag. But I did not see anything in the thread mentioning the wrong or better not rendering of the acf_time tag:

1 Like

Hi Benjamin, for me acf_time is still not working. It just renders the date of today in the frontend (in English) – instead of the time set in the ACF time picker in the backend. I can force it with format to display as a time instead of the date of today, but it only shows as “0:00”.

Is there a solution in sight?

Wow, I somehow missed the fact that you were talking about a different field type despite you mentioning it three times. Sorry about that haha! :sweat_smile:

Can confirm, acf_time seems to display today’s date by default. Sorry for accidentally gaslighting you.

That being said, I just tested this on a fresh WordPress installation and by specifying a format with something like <Field acf_time=time_field format="g:i a" />, I’m successfully able to display the correct time from the field. Obviously this shouldn’t be necessary, but I’m wondering why you’re seeing “0:00”. Are you sure the time field is set on the post you’re referencing?

In any case, I’ve reported the issue with acf_time getting the wrong default format on Github.

No problem. Thank you for taking a look into the problem :smiley:

I have some acf_time fields. They all show the date of today in the frontend. In the backend I have the acf time field (no date & time field, only time) and select the time in the dropdown provided by acf.

<Field acf_time="uhrzeit" />

Shows the date of today in English, no time.

<Format date="H:i"><Field acf_time="uhrzeit" /></Format>

Shows only “00:00” (I tested it in multiple posts and different entries).

And with the acf_date time I have the same problem as mentioned above. It is shown correct in the frontend if I add a format. That’s why I thought I could do the same for acf_time but it is not working for me (only “00:00” as I already mentioned)

Just tested it with the format shorthand attribute in the Field declaration. That is a workaround, you are right!

For the date field this kind of formatting wasn’t working for me, I tried at first but I had to use <Format>…</Format> to display the date in German and the way I wanted it to be, like:

<Format date="j. F Y" locale=de><Field acf_date="termin" /></Format>

Therefore I wrote it in the same way for the time field (as mentioned in my other post) with no success (00:00). But this code shows the time set in the field in the backend:

<Field acf_time="uhrzeit" format="H:i"/>

May be interesting for your troubleshooting.

Ah, this actually seems like the expected output, considering the bug we identified earlier. What’s happening here is that the inner <Field acf_time="uhrzeit" /> part isn’t displaying the correct format, as per the bug. It’s displaying the current date instead of the time, something like “February 22, 2024”. Then your Format tag is trying to convert the value “February 22, 2024” into a time value, which understandably fails and outputs the time “0:00” as one might expect, since there’s no time value to format.

That’s odd. When I test on my end, I have an ACF date field that contains the value “21/02/2024” and when I output it with something like <Field acf_date=date_field format="F j, Y g:i a" /> it displays “February 21, 2024 12:00 am”, as expected.

In any case, as far as I can tell, specifying a format using the attribute seems to work across all field ACF date/time field types on my end, so that would be the workaround until the devs fix the bug and L&L displays the intended format without needing to specify it.

That is true. Thanks a lot for your effort (!) and the explanation.

1 Like