Events Made Easy Forums Bug fixed or feature request implemented Recurring – dates and time

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #42611
    Anonymous
    Inactive

    I’m not sure if this should be posted as a bug or feature recuest, so it goes as a feature request:

    Recurring event with a end time that is less than start time, shows start and end date as the same.

    My suggestion is to increment the end date by one, if the end time is less than the start time.

    Best/

    Andy

    #47106
    Franky
    Keymaster

    Not a bug, but by design. But anyway: for events in recurrence, start and end date are always the same. For the recurrence itself: you need to give the correct end date then 🙂

    #47107
    Anonymous
    Inactive

    If I have a weekly recurrence from, let’s say, 2011-03-09 to 2011-04-30 with time set to 22:00 – 01:00 …all the events duration will be -21 hours.

    Is that by design?

    #47108
    Franky
    Keymaster

    Well, it is by design, see in eme_recurrence.php, function eme_insert_events_for_recurrence:

    $event = $event;

    This is of course not the correct behaviour in your case, but it has been like even before I forked from the original plugin. But I got your explanation a bit wrong here, so let me code up the “+1” day if the end time is lower than the start time (I got it wrong with start/end date/time explanation)

    #47109
    Franky
    Keymaster

    ok, coded in trunk. Can you check this out:

    http://plugins.trac.wordpress.org/changeset/356233

    #47110
    Anonymous
    Inactive

    Ah great! This also fixes an issue with taking an event out of recurrence …it made end-datetime = start-datetime, if end-time < start-time.

    Great!

    Actually …this could be implemented for single events as well …as it would be a common problem in other situations, due to userinput.

    Thanks!

    Andy

    #47111
    Franky
    Keymaster

    Done also in trunk 🙂

    See:

    http://plugins.trac.wordpress.org/changeset/356301

    #47112
    Anonymous
    Inactive

    You are FAST!

    #47113
    Franky
    Keymaster

    Sometimes I am 🙂 Sometimes I am incredibly slow 😉

    #47114
    Anonymous
    Inactive

    Haha …yes …me too 😉

    #47115
    Anonymous
    Inactive

    Ok …still not working 100% …one thing is missing.

    Tjeck end-day first (if left blank) then set it to start-day. Then ad one day to end-day if end-day = start-day and end-time < start-time.

    E.g.:

    // This one is missing (if left blank, or error in input)!!

    if ($event < $event) {

    $event = $event;

    }

    if ($event = $event && $event < $event) {

    $event = date(“Y-m-d”, strtotime(str$event)+86400);

    }

    #47116
    Franky
    Keymaster

    And what about this:

    if ($endstring<$startstring) {
    $event['event_end_date']=date("Y-m-d",strtotime($event['event_start_date'])+86400);
    }

    ==> don’t check for smaller than or equal for dates, it’s the endstring/startstring that matters.

    #47117
    Franky
    Keymaster
    #47118
    Anonymous
    Inactive

    Well …the thing is …there is a difference …tjecking the day and correcting that, before doing the over-midnight fix is key.

    The end day might be ‘1700-01-01’ if not filled out …making it at least the same as the start day, is first.

    Then …the fix you made above.

    #47119
    Anonymous
    Inactive

    An example of userinput for a single-day event that spans midnight:

    start-day: 2011-01-01

    end-day: none

    start-time: 22:00

    end-time: 01:00

    startstring: 2011-01-01 22:00

    endstring: 1700-01-01 01:00

    If the day-fix is not applied first, the result will be:

    startstring: 2011-01-01 22:00

    endstring: 1700-01-02 01:00

    The day-fix does this:

    startstring: 2011-01-01 22:00

    endstring: 2011-01-01 01:00

    The over-midnight-fix does this:

    startstring: 2011-01-01 22:00

    endstring: 2011-01-02 01:00

    So, first day-fix, then over-midnight-fix

    //day-fix:

    if ($event < $event) {

    $event = $event;

    }

    //over-midnight-fix

    if ($endstring<$startstring) {

    $event=date(“Y-m-d”,strtotime($event)+86400);

    }

    #47120
    Anonymous
    Inactive

    Yes! That’s the one! I implemented it, and it works!

    #47121
    Anonymous
    Inactive

    Still needs to be updated in eme_recurrence.php 🙂

    #47122
    Franky
    Keymaster

    I changed it like that (it is what I intended)

    http://plugins.trac.wordpress.org/changeset/358162

Viewing 18 posts - 1 through 18 (of 18 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top