Help Desk

Show Day Name next to Date Month View

  • Posts: 14 Topics: 6
    | Permalink

    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.
    -Rich

    Posts: 11242
    | Permalink

    Hi, 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.

    Posts: 14 Topics: 6
    | Permalink

    Hi 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 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

    Posts: 11242
    | Permalink

    Rich, that code worked for me: https://cl.ly/7173ffb2048f

    Make sure to clear your browser and site caches.

    Let me know…

    Posts: 11242
    | Permalink

    Oh, try unchecking “Enable the Month View Cache” at wp-admin > Events > Settings > Display tab.

    Posts: 14 Topics: 6
    | Permalink

    Hi Cliff,

    It is fixed now. It must have been a caching issue.Thanks for all of the help. I appreciate it.

    -Rich

    Posts: 11242
    | Permalink

    You bet! Glad to hear and thanks for letting us know.

    | Permalink