• Resolved patsky

    (@patsky)


    We have been using your brilliant plugin for a long while now but have noticed that recurring events are no longer correctly displaying. We have set a recurring event for the first Monday of the month and it shows on the 1st of each month. If you look on Friday 1st July you will see three events which should be on the first Friday or first Monday of the month. You can see same for 1st August. One is a duplicate test created under the latest version of the plugin (has Mon in brackets) but still the same.

    Any ideas what has gone wrong?

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    Hi @patsky,

    Are these events already created, or is it happening when you create new events?

    I’m not able to reproduce this myself (nor can the other support staff), so any steps you provide if you can reliably reproduce this would be helpful. Also, if I could know the exact date ranges of the event, frequency, times etc. as well as the timezone of the event, your EM default timezone and your blog default timezone.

    Hi Patsky

    We have discussed some possibillities, but now I had a look at your calendar and noticed another problem which may be the root of your issue.
    On the calendar shown all dates are wrong!!
    Today it is saterday the 28, but your calendar shows 30 !!
    So your whole calendar has shifted two days in advance !
    Regards,
    Peter

    Patsky,

    If you scroll down to the next month the days are matching the calendar of july !!
    So it is the representation of the calendar that is wrong.
    It shows the month of june in your example, and if you scroll down you see the start of juli, where the appointment is set on wednesday I believe.
    Maybe this gives you a clue what is wrong.
    It seems to shift the startday of the week somehow, you tested that by setting it to monday with no succes.
    Regards,
    Peter

    Hi Patsky

    I was a bit confused by the way your calendar is shown.
    So I tested it on my system, and the calendar is more or less shown in the same way
    But on my calendar the days from the previous month are greyed out, so it is more clear where you have to start looking.
    Take a look at this page https://helpdesk.hospiceamandi.nl/?page_id=642
    If you switch to the next month then you will see the re-occurring event I put in there to test it. On my system (Dutch) every thing works fine as you can see.
    It makes me wonder if your system date is correctly set ??
    Have a nice weekend

    Thread Starter patsky

    (@patsky)

    Hi Peter

    Sorry for the delayed reply and thanks for your continued interest and input in solving this! Much appreciated. Yes I agree the display is maybe a bit confusing but I have now made the event free days the same colour which I hope is a bit of an improvement. More unclear when the current day is at the end of the month and the first begins towards the end of the week perhaps!

    The current day is shown in orange and is correct so the system date is right. I have another church site where the issue is exactly the same. I see the author has now responded so I will update those posts too.

    Thread Starter patsky

    (@patsky)

    Peter
    By the way, the other site has the week start on Sunday as it’s a church. So that isn’t a factor either!

    https://dealstandrews.org.uk/diary/

    The E&B test should be From 2018-07-02 to 2019-01-06, the first Sunday of the month. As you can see it is the first of every month.

    • This reply was modified 6 years, 7 months ago by patsky.
    • This reply was modified 6 years, 7 months ago by patsky. Reason: Forgot link
    Thread Starter patsky

    (@patsky)

    @netweblogic Marcus
    Thanks for your response.

    All the existing entries are fine. They were all created on an earlier EM version but I can’t pinpoint which – At least two versions ago. Nearly all on one site would have been last Christmas as it is a church and I enter them all for the year. It is when creating a new entry OR amending an existing that the problem arises. I posted these details on the other post but here for ease and completeness.

    —-

    Steps:
    Create a recurring event
    Event repeats monthly every 1 month on the 1st Sunday of the month.
    recurrences span from 07/02/2018 to 01/06/2019
    each event spans 0 days
    Events ended up being scheduled: 8/1/2018, 9/1/2018, 10/1/2018, etc.

    No Timezone

    EM Settings:
    Enable time zone support: no

    WP Settings:
    General>Timezone: London
    General>Week Starts: Sunday

    Notes: I have this issue on two sites – have tried with Timezone support enabled and disabled – no difference
    Week starts on Sunday on one and Monday on the other – no difference either.

    I have been using EM for over two years now on two non-profit sites – a church and a carers association and this was only noticed a couple of updates ago on the latter but can’t be sure about the version. I realise this is a free plugin but I don’t get paid for this either and unfortunately our groups have come very definitely to rely on this.

    I’m nervous of deleting the plugin and reinstalling or overwriting with an earlier version, particularly on the church site as it has a large number of recurring events for the various services and masses although they were only entered for the year and I will be stuffed if I can’t get this sorted by Christmas! If there is a way of protecting all the existing entries then happy to try anything you suggest.

    Hi patsky

    Indeed the starting day of the week does not matter.
    So also your system date is correct.
    The only other thing I can think of is that you have another plugin running that destroys the date handling. If possible it could be worth a try, to deactivate all plugins but Appointments, and then create a new reoccurring event. As it has been running properly before, I do not think that the template you are using is the cause of the problem. Which template is that, maybe I can install it on my environment to see if that is causing the problem.
    It seems to me that the calculation does not add up the fact that it should be the first sunday after the first day of the month.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    OK, so it turns out to be a PHP issue, not an EM bug, which is why we had such a hard time reproducing this, and also why some see it working on some sites and not on others. The issue specifically affects PHP versions 5.3 – 5.5.

    If you’re running PHP 5, we recommend you run the latest version of that version because all other versions are already not supported anymore. However, we’ve fixed the issue anyway.

    We’ve just release a new dev version 5.9.5.1 which has the fix. You can upgrade your site with a few clicks as per these instructions.

    In case you’re interested, here’s a proof of concept which shows with regular PHP functions why this is not working as expected:

    
    <?php
    	echo "PHP Version is : ". phpversion().'<br>';
    	$DateTime = new DateTime("2018-07-02");
    	echo '<strong>$DateTime = new DateTime("2018-07-02");</strong><br>';
    	echo '<strong>echo $EM_DateTime->format("Y-m-d");</strong><br>';
    	echo $DateTime->format("Y-m-d");
    	echo '<br><strong>$DateTime->modify(\'first day of this month\')->setDate( 2018, 7, 22 );</strong><br>';
    	$DateTime->modify('first day of this month')->setDate( 2018, 7, 22 );
    	echo '<strong>echo $DateTime->format("Y-m-d");</strong><br>';
    	echo $DateTime->format('Y-m-d');
    	die();

    Paste this into a new .php file somewhere on your server and visit it directly and see the results.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    can you try and confirm using EM version 5.9.5? thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Recurring events not correct’ is closed to new replies.