a-schild / churchtools-wp-calendarsync

Synchronise churchtools calendar with wordpress events manager
GNU General Public License v2.0
1 stars 1 forks source link

Recurring events are not always synched correctly to WP #2

Closed a-schild closed 1 year ago

a-schild commented 1 year ago

Needs to process the additions or the repeatId, and probably use the additions->id's too in the sync table

   {
      "base": {
        "id": 600783,
        "caption": "Nidau: Jungschar-Nachmittag",
        "note": "EL",
        "address": {
          "meetingAt": "Bibliotheksplatz Nidau",
          "street": "Hauptstrasse 73",
          "addition": null,
          "district": null,
          "zip": "2560",
          "city": "Nidau",
          "country": "CH",
          "latitude": "47.1244565",
          "longitude": "7.2411075"
        },
        "version": 1,
        "calendar": {
          "id": 32,
          "name": "Anlässe FW und extern",
          "nameTranslated": "Anlässe FW und extern",
          "sortKey": 14,
          "color": "#f691b2",
          "isPublic": true,
          "isPrivate": false,
          "randomUrl": "Y4qjxtxPOAFutQ4A7cLriupJlaFMYvuw",
          "iCalSourceUrl": "",
          "campusId": null,
          "eventTemplateId": null,
          "meta": {
            "modifiedDate": "2018-01-24T14:22:11Z",
            "modifiedPid": 1
          }
        },
        "information": "Treffpunkt beim Bibliotheksplatz Nidau\nKontakt:\njsnidau@cevi.ch\n",
        "image": null,
        "link": "",
        "isInternal": false,
        "startDate": "2023-11-04T13:00:00Z",
        "endDate": "2023-11-04T16:15:00Z",
        "allDay": false,
        "repeatId": 999,
        "repeatFrequency": null,
        "repeatUntil": null,
        "repeatOption": null,
        "additions": [
          {
            "id": 1107,
            "date": "2023-11-18",
            "isRepeated": false,
            "meta": {
              "modifiedDate": "2023-09-05T15:50:09Z",
              "modifiedPid": 1516
            }
          },
          {
            "id": 1108,
            "date": "2023-12-02",
            "isRepeated": false,
            "meta": {
              "modifiedDate": "2023-09-05T15:50:09Z",
              "modifiedPid": 1516
            }
          },
          {
            "id": 1109,
            "date": "2023-12-16",
            "isRepeated": false,
            "meta": {
              "modifiedDate": "2023-09-05T15:50:09Z",
              "modifiedPid": 1516
            }
          }
        ],
        "exceptions": [],
        "signup": null,
        "meta": {
          "createdDate": "2023-09-05T15:50:09Z",
          "createdPerson": {
            "id": 1516
          },
          "modifiedDate": "2023-09-28T07:28:50Z",
          "modifiedPerson": {
            "id": 1
          }
        },
        "onBehalfOfPid": null
      },
      "calculated": {
        "startDate": "2023-11-04T13:00:00Z",
        "endDate": "2023-11-04T16:15:00Z"
      }
    }
a-schild commented 1 year ago

The hp5 lib does not distinguish between the item start/end dates and the calculated start/end date. In addition the event ID is the same for all occurences of the same event serie, causing it to deleteall but the latest event in WP

"calculated": { "startDate": "2023-11-04T13:00:00Z", "endDate": "2023-11-04T16:15:00Z" }

a-schild commented 1 year ago

https://github.com/5pm-HDH/churchtools-api/issues/176

a-schild commented 1 year ago

Fixed in v1.0.1