miyako / 4d-plugin-ical

4D plugin to access to the CalendarStore API (10.5 to 10.7). For 10.8 and Reminders, use Event Kit.
0 stars 2 forks source link

$json:=iCal Find event ($eventId) #3

Open ArminDeeg opened 4 years ago

ArminDeeg commented 4 years ago

Hi, the ical Find event in your code use the event id as 1st parameter, your wiki description shows a json object.

The json return parameter for this object does not return the $event.uid. So I've add the $event.uid by myself.

Sample: $json:=iCal Find event ($eventId) If ($json#"") $event:=JSON Parse($json;Is object) $event.uid:=$eventId $event.title:=$vt_Titel $event.startDate:=String($vd_terminDate;ISO date GMT;$vT_TerminZeitVon) $event.endDate:=String($vd_terminDate;ISO date GMT;$vT_TerminZeitBis) $error:=iCal Modify event (JSON Stringify($event)) end if

$error returns 0 but the event gets not changed. Oh on repeat it return $error=2

Do I something wrong ?

I got it, I had to remove the empty parts to get it work: OB REMOVE($event;"alarms") OB REMOVE($event;"recurrence") OB REMOVE($event;"attendees") OB REMOVE($event;"url")

$json:=iCal Find event ($eventId) If ($json#"") $event:=JSON Parse($json;Is object) $event.uid:=$eventId $event.title:=$vt_Titel $event.startDate:=String($vd_terminDate;ISO date GMT;$vT_TerminZeitVon) $event.endDate:=String($vd_terminDate;ISO date GMT;$vT_TerminZeitBis) OB REMOVE($event;"alarms") OB REMOVE($event;"recurrence") OB REMOVE($event;"attendees") OB REMOVE($event;"url") $error:=iCal Modify event (JSON Stringify($event)) end if