Showing "Time: all day event" at Details level

Home Forums Calendar Products Events Calendar PRO Showing "Time: all day event" at Details level

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1178370
    Monica Filos
    Participant

    Hi, I would like to be able to show that an event is an “all day event” at the Details level on an event view. I did try setting a time start at 1200am and a time end at 1159pm (Title 01.jpg) and partially did the trick (although not as nicer as just reading “Time: all day event”) but then, such information was also displayed at the title level which was not nice at all (Title 02.jpg).

    So, how to display it on Details without impacting the title?

    Regards,
    Monique

    • This topic was modified 7 years, 6 months ago by Monica Filos.
    • This topic was modified 7 years, 6 months ago by Hunter.
    #1178820
    Hunter
    Moderator

    Hey Monica,

    Happy Tuesday! If you set the start and end time to the same time (see screenshot below), the plugin should display the ‘All Day Event’ text you’re seeking in the title, and display the event start time under the event ‘Details’ section. Can you try this and let me know if that achieves what you’re looking for? Please keep me informed and have a great evening. Cheers!

    #1178982
    Monica Filos
    Participant

    Hi Hunter, the results are as follows:

    At title level: “1 de enero de 2017 a las 12:00 am”
    At Details level:
    Hora:
    12:00 am

    Now, as you have noticed, my site is in Spanish, so what I really need is:
    At title level: “1 de enero de 2017” –> only the date without anything else as happens when I click the all event toggle button
    At Details level:
    Hora:
    Todo el día

    “Todo el día” is the translation for “All day” I need this in writing because it makes no sense to me to have to put 12:00 am (an odd time) for all those events that are a commemoration. It would if these events were like training when you refer to lets say 9 to 5 which is understood as an all day event but in my case Im talking about New Year, Christmas, Valentine´s, etc.

    I thought that by asking you to get a written all day event I could later go to the PO / MO file and translate it myself but seems now that I better explain a bit better the need.

    Hope this helps.
    Once again, thank you for all the effort.
    Monique

    #1180324
    Hunter
    Moderator

    Thank you for your patience,

    While this type of request is typically outside the scope we’re able to support (see What support is provided for license holders?), please try adding the following code to the bottom of your theme’s functions.php file and let me know how it goes.

    /* Tribe, add text to All Day events date */
    function tribe_modify_all_day_date ( $inner, $event_id ) {

    // bail if it's not an all day event
    if ( !tribe_event_is_all_day( $event_id ) || !is_singular(Tribe__Events__Main::POSTTYPE) ) return $inner;

    // add custom text to date string
    return $inner .= '- All day event';
    }

    add_filter ( 'tribe_events_event_schedule_details_inner', 'tribe_modify_all_day_date', 10, 2 );

    Thanks again and have a great Friday. Cheers 🙂

    #1181221
    Monica Filos
    Participant

    Hi Hunter, that was perfect for the title portion of it, thank you!!!

    Now, how do we make it show that info at the Details area? It´s currently not showing anything.

    Regards,
    Monica

    #1182043
    Hunter
    Moderator

    Monica,

    Try creating a template override for /the-events-calendar/src/views/single-event.php as explained in our Testing for conflicts guide and use the entire code found here.

    You will need to take the reigns from here. Let me know how it works out and best of luck. Cheers!

    #1192490
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Showing "Time: all day event" at Details level’ is closed to new replies.