• Resolved EastDevonAlliance

    (@eastdevonalliance)


    When I use the shortcode plugin to generate a list of events, I get code like this:

    <span class="duration time">
        <span class="date-start dtstart">2 December @ 3:00pm
            <span class="value-title" title="2015-12-02GMT03:00"></span>
        </span>
         -
        <span class="end-time dtend">5:00pm
            <span class="value-title" title="2015-12-02GMT05:00"></span>
        </span>
    </span>

    As you can see, the actual times are e.g. 3pm but the timestamp is 3am.

    I have traced this to /the-events-calendar/src/functions/template-tags/general.php lines 1083-1084 which read e.g.:

    $microformatStartFormat = tribe_get_start_date( $event, false, 'Y-m-dTh:i' );

    but which I think should read:

    $microformatStartFormat = tribe_get_start_date( $event, false, 'Y-m-dTH:i' );

    as ‘h’ means 12 hour format and ‘H’ 24 hour format.

    I have tested this change and it seems to do the trick.

    https://wordpress.org/plugins/the-events-calendar/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Brian

    (@brianjessee)

    HI,

    Thanks for providing this information.

    What shortcode plugin are you speaking of?

    Thanks

    Thread Starter EastDevonAlliance

    (@eastdevonalliance)

    Not at home at the moment but it’s the third party plugin in the store which you can use to list events.

    But this uses your code to format the events, and I tracked this minor time format bug down into your code. (Very well written code BTW.)

    Sorry but we can’t provide support for third-party plugins. You might want to try asking them for support. Thanks for your understanding.

    Thread Starter EastDevonAlliance

    (@eastdevonalliance)

    Clifford

    I am NOT asking you to support a 3rd party plugin.

    I AM asking you to implement a solution to a bug in your code that I have diagnosed and provided you with the fix for.

    It is obvious that the timestamp code should be in 24hr and not 12hr format – and the fix I provided is trivially small and easily understood.

    So I am unclear why you are refusing to implement this, and I would ask you to reconsider.

    Many thanks.

    Paul

    Plugin Contributor Brian

    (@brianjessee)

    Ok we are looking into it.

    Paul, I discussed your bug report with one of our developers and with Brian.

    We appreciate your assistance with resolving any possible bugs in the code, but we can’t seem to relate the code you cited with anything we see in our current release.

    Would you please make sure you’re on the latest version and, if you think the issue still needs to be fixed, submit a pull request to our Github repo? If we do implement your pull request, you’ll get official props in the changelog.

    Thank you very much for helping make The Events Calendar the best it can be!

    Thread Starter EastDevonAlliance

    (@eastdevonalliance)

    I have not upgraded to the latest version because I have applied this fix to the current version at the time I fixed it and cannot upgrade until you have applied the same fix to your version. I am on version 3.12.6.

    However. I have taken a look at the source code of 4.0.2 which has undergone major restructuring and tracked the equivalent down to DBDATETIMEFORMAT in tribe-common/src/Tribe/Date_Utils.php which is: const DBDATETIMEFORMAT = 'Y-m-d H:i:s';

    Since this is using upper-case H, it would seen that this has indeed been resolved in the current version.

    I will upgrade to this version of the plugin as soon as I get the chance and check it is working as expected.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘span.value-time title time format incorrect’ is closed to new replies.