DATE format for day view

Home Forums Calendar Products Events Calendar PRO DATE format for day view

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #90907
    Krzysztof
    Participant

    I found snippet code changing date format for day view but how to change time format to 24h? It is english 12h format (am/pm) now.

    #91682
    Barry
    Member

    Hi! Just to clarify, you mean like in my example below?

    sched-details

    #92002
    Krzysztof
    Participant

    No, I mean hours in the black bar (e.g. 10AM or 6PM):
    http://www.kultura.itarnow.pl/wydarzenia/2014-01-15/

    #92103
    Barry
    Member

    Oh I see. Right now you could override and customize the pro/day/loop.php template and locate this line:

    <h5><?php echo $current_timeslot; ?></h5>

    Then change it to:

    <h5><?php
    if ( false !== ( $meridiem = strpos( $current_timeslot, 'am' ) ) )
    echo substr( $current_timeslot, 0, $meridiem ) . 'hr';
    
    elseif ( false !== ( $meridiem = strpos( $current_timeslot, 'pm' ) ) )
    echo ( 12 + (int) substr( $current_timeslot, 0, $meridiem ) ) . 'hr';
    ?></h5>

     

    #92112
    Barry
    Member

    Just to follow up, we have been working hard to ensure there is an easier means of changing time/date formats like this one – but this particular case seems to have been missed, however we will certainly try to introduce a change that makes this easier going forward.

    Hope that helps!

    #92715
    corvo
    Participant

    Hi! I’m having the same issue with the 12h (am/pm) format on the day view page. But my pro/day/loop.php doesn’t appear in the WP Editor. Is there someway for me to work around that?
    Thank you!

    #92875
    Krzysztof
    Participant

    Thanks for your help, Barry. Now time format looks right.

    #93772
    Leah
    Member

    Hi corvo,

    We’d be happy to help you out, but please start your own thread. That was we’ll be able to focus on your situation and help you directly. Thanks!

    Best,
    Leah

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘DATE format for day view’ is closed to new replies.