Home › Forums › Calendar Products › Events Calendar PRO › Show Day Name next to Date Month View
- This topic has 6 replies, 2 voices, and was last updated 5 years, 6 months ago by Cliff.
-
AuthorPosts
-
October 2, 2018 at 11:45 am #1635716SheaParticipant
Hi,
I know that this needs to a template edit to the month/single-day.php. What we want to do is to add the day name next to the date on each day of the month. I can’t figure out how to call this from the
tribe_events_get_current_month_day()
function.Thanks for the help.
-RichOctober 4, 2018 at 6:08 am #1637223CliffMemberHi, Shea/Rich.
This is an example of some data that comes from tribe_events_get_current_month_day(): https://cl.ly/317c1154f815
You could do something like this with it:
$datetime = DateTime::createFromFormat('Y-m-d', $day['date'] ); // 2018-10-04 echo $datetime->format('D'); // Thu echo $datetime->format('l'); // Thursday
You might also want to pass the time zone, but this is just a proof-of-concept.
See https://secure.php.net/manual/datetime.createfromformat.php for more details.
Please let me know how this goes for you.
October 5, 2018 at 7:43 am #1638187SheaParticipantHi Cliff,
I tried the code you suggested on the single-day.php. You can see the edits that I made on lines 33 and 34 of the file https://gist.github.com/richsalvucci/6399b6b0a060646798a642540d590914. There is no change on the display. I have tried the file paths in my child theme of tribe-events/month and tribe-events/pro/month/ but neither path worked. Did I misplace the code in the file? Thanks for the help.
-Rich
October 5, 2018 at 3:52 pm #1638631CliffMemberRich, that code worked for me: https://cl.ly/7173ffb2048f
Make sure to clear your browser and site caches.
Let me know…
October 5, 2018 at 3:54 pm #1638632CliffMemberOh, try unchecking “Enable the Month View Cache” at wp-admin > Events > Settings > Display tab.
October 9, 2018 at 5:55 am #1639969SheaParticipantHi Cliff,
It is fixed now. It must have been a caching issue.Thanks for all of the help. I appreciate it.
-Rich
October 9, 2018 at 12:23 pm #1640376CliffMemberYou bet! Glad to hear and thanks for letting us know.
-
AuthorPosts
- The topic ‘Show Day Name next to Date Month View’ is closed to new replies.