[Resolved] How do I output the name of the day of the week with a date field
This thread is resolved. Here is a description of the problem and solution.
Problem:
The user had used out datepicker field to select a date on the backend but only wants to display the Day rather than the entire date.
Solution:
This can be done using the following shortcode.
[types field='agenda-datum' style='text' format='l'][/types]
Where you will replace "agenda-datum" with the slug of the custom field and using the format attribute to choose which component of the date you want to display or how you would like the date to be formatted.
Tell us what you are trying to do?
Ik want to show the name of the day in a view when outputing the date.
Is there any documentation that you are following?
I used PHP date formating characters D en l, but they don't seem to work
Is there a similar example that we can see?
What is the link to your site?
hidden link
I would want to output for instance 'zondag 23 aug 2020'. 'Zondag' is Dutch for Sunday. So I would want to output the day of the week. I use a datefield for the dates in the agenda with events.
Is there a way to do this? I tried this: [types field='agenda-datum' style='text' format='l'][/types] and [types field='agenda-datum' style='text' format='D'][/types]. Both didn't work.
The problem is that to build the dates in the agenda I use 3 shortcodes for the same date field. Each with a different format: the first to show the date number, the second to show the month, and the third to show the year. If I add another shortcode with the format as you described, I simply couldn't save. I get an error message in red which says that one or more sections could not be saved.
I tested your shortcode instead of an an existing one and your shortcode works just fine. So I was wrong. The format l of D works oké. But if I added it (so I use four shortcodes) I get the error message. Maybe it is a memory issue or something like that. At least it seams not to be a toolset problem 🙂
What I have done now is, I removed the year and instead used the name of the week day. So everything is just fine.
Thanks for your help. You guys are allways great!!
Have a nice day!!
Sandra