How to get rid off the th from the day

Home Forums Calendar Products Events Calendar PRO How to get rid off the th from the day

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1093866
    Wolfgang Leideck
    Participant

    Hello.

    I am using the Events Calendar Pro at the right sidebar of my front page to show the events of the current week.
    Every day has a headline with following format ‘Mon 21nd’ or ‘Do 24th’. In the configuration of the Events calendar I defined following format for the week day : D j. but this won’t show in the list view at the Headlines.
    So my question is, how can I get rid off the extensions ‘nd’ or ‘th’?

    Thanks
    Wolfgang

    #1093987
    George
    Participant

    Hey Wolfgang,

    Thanks for reaching out!

    Fixing this will unfortunately require a tiny bit of custom coding at this timeโ€”head to your theme’s functions.php file and try adding this snippet of code there:


    add_filter( 'tribe_events_this_week_date_format', 'tribe_remove_suffix_from_this_week_date' );

    function tribe_remove_suffix_from_this_week_date( $date ) {
    return 'j';
    }

    Let me know if this helps! ๐Ÿ™‚

    โ€” George

    #1094269
    Wolfgang Leideck
    Participant

    Thank you George, but the Code snippet doesn’t work.
    I get following warning

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'tribe_remove_appendage_from_this_week_date' not found or invalid function name in /homepages/13/d467711818/htdocs/hundeschule/wp-includes/plugin.php on line 235

    And only the name of the day is displayed.

    #1094443
    George
    Participant

    Hey there,

    That warning is likely from a typo I fixed on the thread, but if you are seeing this over email or saw it before I updated the thread then the correction might not have been made yet. Instead of what I originally recommended, try this:


    add_filter( 'tribe_events_this_week_date_format', 'tribe_remove_suffix_from_this_week_date' );

    function tribe_remove_suffix_from_this_week_date( $date ) {
    return 'j';
    }

    I hope this helps!

    Sincerely,
    George

    #1094581
    Wolfgang Leideck
    Participant

    Thank you George.
    The code works now.

    Sincerley,
    Wolfgang

    #1094604
    George
    Participant

    Awesome! ๐Ÿ™‚

    I’ll close up this thread for now, but open a new thread any time if there’s anything else we can help with.

    โ€” George

    #1100854
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘How to get rid off the th from the day’ is closed to new replies.