Working on a new widget, and it displays date information in a couple of ways. The header is set to show the month and year, ex: October 2026. There’s a section on the left with something that looks like how cal_date renders, but is just the day of the week and the date, ex: THUR 23. Then in the description area of the event, it displays a more complete date/time, ex: October 23 @ 5:30 - 7:30 p.m.
The header and description times are easy enough to do. For the other one, I’m a little stumped. Easiest thing to me would be to modify what cal_date outputs. Otherwise, I’d expect to use some more specific variables, something like date_weekday maybe. Is there a way to accomplish either of these options?
You can use the date in a <field> with a date_format attribute. You can use it multiple times with different formats to get different parts of the date. Then style with CSS.
Hi there – sure thing, using <field var you can re-cast a date using date_format= and any PHP-valid date string, e.g. <field var="date" date_format="M"/> and <field var="date" date_format="j"/>. Hope this helps!