This topic is locked

Can't Modify a Recurring Event

11/13/2013 9:46:05 AM
Calendar Template general questions
S
Stoneman author

I have a project built with PHPRunner 7 calendar template pack 7. We needed to change the end date on some of our recurring events and received an error stating "Invalid event date or time".

This can be fixed easily enough if you want.
On the edit page BeforeEdit function (located in the Before record updatedpn the PHPrunner event editor tab)

Find the following code:
if(($values["Recurrence"]!=1 && strtotime(now())-strtotime(mydate("Y-m-j",strtotime($values["DateField"]))." ".$values["TimeField"])>=0 || $values["Recurrence"]==1 && strtotime(now())-strtotime(mydate("Y-m-j",strtotime($values["DateField"]))." ".$values["TimeField"])>0) && $values["DayEvent"]!=1 || (strtotime(mydate("Y-m-d",""))-strtotime($values["DateField"]))/606024>0 && $values["DayEvent"]==1 && $values["Recurrence"]!=1)
And change it to read the following:
if(($values["Recurrence"]!=1 && strtotime(now())-strtotime(mydate("Y-m-j",strtotime($values["DateField"]))." ".$values["TimeField"])>=0 || $values["Recurrence"]==1 && strtotime(now())-strtotime(mydate("Y-m-j",strtotime($values["DateField"]))." ".$values["TimeField"])>0 )!=0)) && $values["DayEvent"]!=1 || (strtotime(mydate("Y-m-d",""))-strtotime($values["DateField"]))/606024>0 && $values["DayEvent"]==1 && $values["Recurrence"]!=1)
This allows you to modify the ending date and time while still preventing modification to the start date for events starting in the past (prior to today)!
Hope this helps someone!