Wrong date formatting in detail view

WordPress Event Management, Calendars & Registration Forums Report A Bug Wrong date formatting in detail view

This topic contains 5 replies, has 2 voices, and was last updated by  Florian Werbinek 5 years, 11 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #29380

    Hi,
    my language is de_de.
    On the details page for an recurring event, the first line says for example:
    Dieser Termin läuft vom 8 Februar 2018 bis 29 März 2018 und findet das nächste Mal am 8. Februar 2018 18:15 statt.

    There are some points missing, and there should be one additional word, it should be:
    Dieser Termin läuft vom 8. Februar 2018 bis 29. März 2018 und findet das nächste Mal am 8. Februar 2018 um 18:15 statt.

    Thanks,
    Florian

    Florian Werbinek
    #29389

    The datetime formatting is based on your site’s settings. You probably don’t want to change it there since it will potentially impact other parts of your site.

    Alternatively you can edit the template in templates/event-meta-event-single.php (copy it to your theme and make the changes there to prevent an update from losing your changes).

    The function call eo_get_event_datetime_format() on line 37 is what determines the date format, based on the site settings. You can specify the date and time formats as the second and third argument: e.g:

    eo_get_event_datetime_format(get_the_ID(), 'j. F Y', ' um g:i ')
    

    You can also change any of that text in the event information.

    Stephen Harris
    #30591

    Hi Stephen,

    I still try to solve this.

    My WordPress formats are set to: Date: j. F Y Time: G:i

    Standard output on a detail page is: Dieser Termin läuft vom 2 Mai 2018 bis 25 Juli 2018 und findet das nächste Mal am 9. Mai 2018 17:45 statt.

    The most important issue are the missing dots for the first dates, it should be: …vom 2. Mai 2018 bis 25. Juli 2018 und… The third date is displayed correctly….

    I also tried to add the “um” like you advised. But that leads to the following: Dieser Termin läuft vom 2 Mai 2018 bis 25 Juli 2018 und findet das nächste Mal am 9. Mai 2018 00000005 5:45 statt.

    Please help… Thank you, Florian

    • This reply was modified 5 years, 11 months ago by  Florian Werbinek.
    Florian Werbinek
    #30656

    Stephen, can you please help?

    Florian Werbinek
    #30693

    Hi Florian,

    If adding text to the time format you need escape it with backslashes. Try \u\m.

    The first two date formats are hardcoded in the template. Copy event-meta-event-single.php from the templates directory into your theme and edit the string j F Y to j. F Y.

    Stephen Harris
    #30695

    Hi Stephen,

    both worked, thanks a lot!

    I copied event-meta-event-single.php to my template root folder, and edited

    eo_get_schedule_start( ‘j F Y’ ), eo_get_schedule_last( ‘j F Y’ ), $next )
    ->
    eo_get_schedule_start( ‘j. F Y’ ), eo_get_schedule_last( ‘j F Y’ ), $next )

    and

    ( eo_get_event_datetime_format() )
    ->
    ( eo_get_event_datetime_format(get_the_ID(), ‘j. F Y’, ‘ \u\m g:i ‘) )

    which results in (example)
    Dieser Kurs läuft vom 7. Mai 2018 bis 30 Juli 2018 und findet das nächste Mal am 11. Juni 2018 um 6:00 statt.

    A lot of improvement for the german language version 🙂

    Florian Werbinek
Viewing 6 posts - 1 through 6 (of 6 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.