WordPress.org

Forums

Events Manager ESS
[resolved] End date is wrongly decoded (5 posts)

  1. dnk6742
    Member
    Posted 1 year ago #

    The event end date is decoded wrongly.

    Solution:
    ESS_Import.php, line 919:
    $_POST['event_end_date'] = date( 'Y-m-d', strtotime( $date_start . ( ( $dur > 0 )? " + " . $dur ." seconds" : "" ) ) );
    replace with $_POST['event_end_date'] = date( 'Y-m-d', strtotime( $date_start . ( ( $dur > 0 )? " + " . $dur . " " . $date_[ 'unit' ] : "" ) ) );

    For time calculations the same should be done with line 923.

    http://wordpress.org/plugins/events-manager-ess/

  2. essfeed
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    it takes sense to use the 'unit' if it is provided within the feed.
    The point is that the 'unit' attribute is not mandatory in the ESS DTD for events that are not 'recurrent'. So in almost all the cases 'unit' will be empty.

    I've placed a string estimation to use the 'unit' attribute for duration calculation if it is provided but if not, use the hard coded 'seconds' for the 'strtotime' calculation.

    Thanks for this report. Like your other reports, they all takes sense.

  3. dnk6742
    Member
    Posted 1 year ago #

    In my case the feed looks like:

    <dates>
    <item type="standalone" unit="hour" priority="1">
    <name>Date: 2013-11-22T11:00:00 03:00</name>
    <start>2013-11-22T11:00:00+03:00</start>
    <duration>2360</duration>
    </item>
    </dates>

    So, unit is a part of item parameters. It is IMHO reasonable to make it mandatory element of a dates/item xml type for standalone events as well.

    Besides that, ESS_Feed.php:120 hard-codes the default duration in hours:
    $duration_s = FeedValidator::getDateDiff( 'h', $event_start, $event_stop ); // number of seconds between two dates.

    I believe there are very few events that last less than one hour, not taking into account flashmobs and particle annihilations :-) Keep also in mind that the pludin itself doesn't allow to schedule the event times up to seconds.

  4. dnk6742
    Member
    Posted 1 year ago #

    Hotfix for 0.9.8:

    ESS_Import:910:
    Date format is H-i-s, but it should be H:i:s. Strtotime doesn't decode the time with dashes.

    Thanks.

  5. essfeed
    Member
    Plugin Author

    Posted 1 year ago #

    Mmm, ok you're right, this one is a real bug not an improvement.
    W've placed seconds as default unit because we live in a decimal world but in the events world hours takes more sense.
    I'm going to fix it in favor of 'hour' for every durations.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager ESS
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.