Setting date-format for acf date field outputs actual date (and \\ doesn't work)
-
Hello Eliot, I think setting the date-format for an acf date field, does not work.
I have read the topic “Show content by date-field” and I got it also work with te acf “date and time picker field” plugin (in the settings of the field, set “safe as timestamp?” and “Get field as timestamp” to “No”).
My code is like this:
[loop type=”announcement” acf_date=”expires” value=”future” orderby=”field_num” order=”DESC”]
[content]
[field acf_date=”expires”]
[/loop]It was hard to get this work. I set the date-format in the field options to “d MM yy” and the time-format to “HH:mm” and didn’t set the date-format as a parameter in the loop shortcode. (My date- and time-format in the general WordPress settings is “j F Y H:i”).
If I don’t set the date_format parameter in the field shortcode, the output for “expires” is “30 februari 2015 22:00”. When I set a date-format (for example “d-m-Y H:m” or “j F Y H:i” (or without the time), not the value of the field will display, but the actual date (and time) in the given format.
I also tried it with the “default” acf date field, but it doesn’t work either.
An other problem: if I use the \\ (double backslashes) before a character in de date_format parameter, the characters will not show.
I hope you can help me with this problem. It don’t have a high priority, so take your time! ??
Thank you in advance!
https://www.ads-software.com/plugins/custom-content-shortcode/
- The topic ‘Setting date-format for acf date field outputs actual date (and \\ doesn't work)’ is closed to new replies.