Modify event’s end date by tribe_get_end_date

Home Forums Ticket Products Event Tickets Plus Modify event’s end date by tribe_get_end_date

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1160202

    Hi,
    could you please help me? Unfortunately I’m not very familiar with php strings, but I need to make a slight change to the tribe_get_end_date file. My event dates should be displayed like this:
    H:i – H:i \U\h\r (for example: 10:00 – 16:00 Uhr)
    Can you give me a clue?
    Thank you very much in advance!
    Best regards,
    Manuela

    #1160642
    Cliff
    Member

    Hi Manuela. Thanks for your detailed question.

    Please visit your wp-admin > Events > Settings > Display tab and refer to our documentation on the date formats at https://theeventscalendar.com/knowledgebase/wp-admin-settings-overview/#dates

    Let me know if this answered your question.

    #1160813

    Thank you Cliff for your reply. Unfortunately this doesn’t solve the problem because there is no field for what I need available in the settings. I’m quite sure I must edit the tribe_get_end_date file or add sth to functions.php, but I’m not familiar with php. Can you help me out?
    Best regards,
    Manuela

    #1160874
    Cliff
    Member

    The tribe_get_end_date() function has a parameter for $date_format, which by default comes from tribe_format_date(), which defaults to using tribe_get_date_format(), which gets the date format specified in the tribe options.

    Long story short, the date format specified in the wp-admin > Events > Settings > Display tab — particularly the first two options in the case you’re asking about — are used unless you need tribe_get_end_date() to have a different $date_format than the rest of your site’s date formats.

    I hope this clears things up even if it’s a bit more detailed than you needed. 🙂

    I’d suggest entering your preferred date format in those 2 settings and then try things out on your site. Let me know if you need some help with the date formats for those 2 options.

    #1161384

    Hi Cliff, thanks for trying, but the settings there are only about date and not about time format. If I insert time there (http://prntscr.com/cfi5ux), I get this result in the frontend: http://prntscr.com/cfi74k
    Maybe I did something wrong…(?) However, even if there is a better way to insert the time into these fields, the result would be: 10:00 Uhr – 16:00 Uhr, but I need the word “Uhr” only at the end of a time period, like this: 10:00 – 16:00 Uhr
    Thank you in advance for further help!

    #1161637
    Cliff
    Member

    Manuela, sorry for my confusion here. Thanks so much for the screenshots and additional details.

    I spoke with one of our developers and it turns out that we do have Date settings that aren’t meant for DateTime settings. Our Time format comes from WordPress’ options: wp-admin > Settings > General > Time Format option

    Please let me know if changing this Time Format option helps in some way.

    FYI: I’ve submitted an internal feature request to have a Time Format option specific to just our plugins.

    #1162061

    Hi Cliff, it’s me the one who has to apologize. Pressing the wrong button often causes confusion 😉
    I changed the wordpress settings, but still this is the result: http://prntscr.com/cg28e8
    Can you help me?

    #1162225
    Cliff
    Member

    No worries at all.

    Please reset your wp-admin > Events > Settings > Display > date formats options back to “date” only and no “time” included.

    If it’s still not working as desired for you, please share your System Information. That will give me a lot of extra information to help diagnose the problem.

    #1162251

    This reply is private.

    #1162292
    Cliff
    Member

    Thanks for sending that.

    I see your Modern Tribe plugins are not at their latest versions:

    Once you verify you’re on the latest versions, please test to see if the issue is still happening for you.

    And since only the latest version of The Events Calendar includes extra system information report information, please re-send a fresh copy of it once you’ve updated.

    Thanks.

    #1162588

    This reply is private.

    #1162817
    Cliff
    Member

    Thank you.

    I see you have this information from your System Information Report:

    dateWithYearFormat = j. F Y
    dateWithoutYearFormat = j. F Y
    monthAndYearFormat = F Y
    weekDayFormat = D jS
    WP DATE FORMAT
    j. F Y
    WP TIME FORMAT
    H:i

    All that looks fine (i.e. no Time output in a Date-only field, or vice-versa). Also, your settings don’t seem to match the format displayed in http://prntscr.com/cg28e8

    Are you still seeing that output? If yes, please clear any caching and switch to a different/new browser to make sure.

    I’d also try switching your site language back to English, seeing what you get for the date + time displays, and if that doesn’t work, please provide me a login to your password-protected site. (Please use the Private Reply option.)

    Thank you.

    #1162912

    Hi Cliff, I had reset the settings already because what was possible is this:
    Event Display Settings: http://prntscr.com/ch7uzi
    Wordpress General Settings: http://prntscr.com/ch7wr7
    But what I need is this example:
    14. September 2016, 19:15 – 21:00 Uhr (“Uhr” only behind the end time of a time period)
    Can you help please?

    #1163635
    Cliff
    Member

    Let’s try a CSS solution (just for the Events List widget):

    .tribe-events-adv-list-widget .tribe-event-time::after {
    content: " Uhr";
    }

    You can add custom CSS code via your child theme’s style.css file or via a plugin like Simple Custom CSS or, my favorite, Jetpack. Jetpack supports regular CSS and the LESS and Sass pre-processors.

    If you’re not a CSS expert, Jetpack’s Custom Design reference may prove helpful.

    Please let me know how it goes for you.

    #1163795

    Thank you Cliff, the CSS solution works great 🙂
    Now I have 2 related issues:
    In the event details the time period should be shown in the same way: http://prntscr.com/chs87p
    In case that the event last over more than one days, the word “Uhr” should be published after the time data of both days: http://prntscr.com/chs79s
    Can you help me here as well please?

Viewing 15 posts - 1 through 15 (of 18 total)
  • The topic ‘Modify event’s end date by tribe_get_end_date’ is closed to new replies.