> test DTEND property with different timezones
DTSTART;TZID=Europe/Berlin:20241017T130000
DTEND;TZID=Asia/Bangkok:20241018T040000
> convert
"start": "2024-10-17T13:00:00",
"timeZone": "Europe/Berlin",
"duration": "PT10H",
"endTimeZone": "Asia/Bangkok",
"iCalendar": {
        "convertedProperties": {
          "duration": {
            "name": "dtend"
          }
        },
        "name": "vevent"
}

> test DTEND property with same timezone
DTSTART;TZID=Australia/Melbourne:20241002T130000
DTEND;TZID=Australia/Melbourne:20241002T140000
> convert
"start": "2024-10-02T13:00:00",
"timeZone": "Australia/Melbourne",
"duration": "PT1H",
"iCalendar": {
        "convertedProperties": {
          "duration": {
            "name": "dtend"
          }
        },
        "name": "vevent"
}

> test DTEND property with DATE value type
DTSTART;VALUE=DATE:20240102
DTEND;VALUE=DATE:20240107
> convert
"start": "2024-01-02T00:00:00",
"timeZone": null,
"duration": "P5D",
"showWithoutTime": true,
"iCalendar": {
    "name": "vevent",
    "convertedProperties": {
          "duration": {
            "name": "dtend",
            "parameters": {
              "value": "DATE"
            }
          },
          "start": {
            "parameters": {
              "value": "DATE"
            }
          }
    }
}    

> test DTSTAMP
BEGIN:VCALENDAR
METHOD:REPLY
BEGIN:VEVENT
DTSTAMP:20240304T132000Z
> convert
{
  "@type": "Group",
  "entries": [
    {
      "@type": "Event",
      "method": "reply",
      "updated": "2024-03-04T13:20:00Z"
    }
  ]
}

> test DTSTART property with TZID parameter
DTSTART;TZID=Europe/Berlin:20240921T105302
> convert
"start": "2024-09-21T10:53:02",
"timeZone": "Europe/Berlin"

> test DTSTART property with UTC time
DTSTART:20240921T105302Z
> convert
"start": "2024-09-21T10:53:02",
"timeZone": "Etc/UTC"

> test DTSTART property with floating time
DTSTART:20240921T105302
> convert
"start": "2024-09-21T10:53:02",
"timeZone": null

> test DTSTART property with value type DATE
DTSTART;VALUE=DATE:20240921
> convert
"start": "2024-09-21T00:00:00",
"timeZone": null,
"showWithoutTime": true,
      "iCalendar": {
        "convertedProperties": {
          "start": {
            "parameters": {
              "value": "DATE"
            }
          }
        },
        "name": "vevent"
}

> test DUE property with TZID parameter
BEGIN:VTODO
DUE;TZID=Europe/Berlin:20240921T105302
> convert
"@type": "Task",
"due": "2024-09-21T10:53:02",
"timeZone": "Europe/Berlin"

> test DUE property with UTC time
BEGIN:VTODO
DUE:20240921T105302Z
> convert
"@type": "Task",
"due": "2024-09-21T10:53:02",
"timeZone": "Etc/UTC"

> test DUE property with floating time
BEGIN:VTODO
DUE:20240921T105302
> convert
"@type": "Task",
"due": "2024-09-21T10:53:02",
"timeZone": null

> test DUE property with value type DATE
BEGIN:VTODO
DUE;VALUE=DATE:20240921
> convert
"@type": "Task",
"due": "2024-09-21T00:00:00",
"timeZone": null,
"showWithoutTime": true,
"iCalendar": {
 "convertedProperties": {
          "due": {
            "parameters": {
              "value": "DATE"
            }
          }
        },
        "name": "vtodo"
}

> test DUE property with value type DATE in combination with DTSTART
BEGIN:VTODO
DTSTART;VALUE=DATE:20250220
DUE;VALUE=DATE:20250221
> convert
"@type": "Task",
"start": "2025-02-20T00:00:00",
"due": "2025-02-21T00:00:00",
"timeZone": null,
"showWithoutTime": true,
"iCalendar": {
        "convertedProperties": {
          "due": {
            "parameters": {
              "value": "DATE"
            }
          },
          "start": {
            "parameters": {
              "value": "DATE"
            }
          }
        },
        "name": "vtodo"
}

> test DURATION
DURATION:PT1H
> convert
"duration": "PT1H"

> test ESTIMATED-DURATION
BEGIN:VTODO
ESTIMATED-DURATION:P2D
> convert
"@type": "Task",
"estimatedDuration": "P2D"

> test non-IANA timezones #1
BEGIN:VCALENDAR
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VEVENT
SUMMARY: TEST Syd
DTSTART;TZID="(GMT+10:00) Canberra, Melbourne, Sydney":20201028T133000
DTEND;TZID="(GMT+10:00) Canberra, Melbourne, Sydney":20201028T150000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20201015T165939Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
END:VEVENT
END:VCALENDAR
> convert
{
  "@type": "Group",
  "entries": [
    {
      "@type": "Event",
      "duration": "PT1H30M",
      "freeBusyStatus": "busy",
      "iCalendar": {
        "convertedProperties": {
          "duration": {
            "name": "dtend",
            "parameters": {
              "tzid": "(GMT+10:00) Canberra, Melbourne, Sydney"
            }
          },
          "start": {
            "parameters": {
              "tzid": "(GMT+10:00) Canberra, Melbourne, Sydney"
            }
          }
        },
        "name": "vevent"
      },
      "priority": 5,
      "privacy": "public",
      "sequence": 0,
      "start": "2020-10-28T13:30:00",
      "status": "confirmed",
      "timeZone": "Australia/Sydney",
      "title": " TEST Syd",
      "updated": "2020-10-15T16:59:39Z"
    }
  ],
  "prodId": "Microsoft Exchange Server 2010"
}

> test non-IANA timezones #2
BEGIN:VCALENDAR
BEGIN:VEVENT
UID:0000001
SUMMARY:Treasure Hunting
DTSTART;TZID="(UTC-05:00) Eastern Time (US and Canada)":20150706T120000
DTEND;TZID=America/Los_Angeles:20150706T130000
RRULE:FREQ=DAILY;COUNT=10
EXDATE;TZID=America/Los_Angeles:20150708T120000
EXDATE;TZID=America/Los_Angeles:20150710T120000
END:VEVENT
END:VCALENDAR
> convert
{
  "@type": "Group",
  "entries": [
    {
      "@type": "Event",
      "duration": "PT4H",
      "endTimeZone": "America/Los_Angeles",
      "iCalendar": {
        "convertedProperties": {
          "duration": {
            "name": "dtend"
          },
          "recurrenceOverrides/2015-07-08T15:00:00": {
            "parameters": {
              "tzid": "America/Los_Angeles"
            }
          },
          "recurrenceOverrides/2015-07-10T15:00:00": {
            "parameters": {
              "tzid": "America/Los_Angeles"
            }
          },
          "start": {
            "parameters": {
              "tzid": "(UTC-05:00) Eastern Time (US and Canada)"
            }
          }
        },
        "name": "vevent"
      },
      "recurrenceOverrides": {
        "2015-07-08T15:00:00": {
          "excluded": true
        },
        "2015-07-10T15:00:00": {
          "excluded": true
        }
      },
      "recurrenceRule": {
        "count": 10,
        "frequency": "daily"
      },
      "start": "2015-07-06T12:00:00",
      "timeZone": "America/New_York",
      "title": "Treasure Hunting",
      "uid": "0000001"
    }
  ]
}

> test multiple timezones
BEGIN:VCALENDAR
DESCRIPTION:We leave the timezones out but we use common names so that they are added.
BEGIN:VEVENT
DTSTART;TZID=America/New_York;VALUE=DATE-TIME:20140829T080000
DTEND;TZID=America/Los_Angeles;VALUE=DATE-TIME:20140829T080000
RDATE;TZID=Europe/Berlin:20240913T120000
SUMMARY:an event with a custom tz name
END:VEVENT
BEGIN:VEVENT
RECURRENCE-ID;TZID=Europe/Moscow:20190309T020000
END:VEVENT
BEGIN:VTODO
DUE;TZID=Asia/Singapore;VALUE=DATE-TIME:20140829T080000
END:VTODO
BEGIN:VEVENT
RDATE;TZID=Mexico/General:20190309T020000
RDATE;TZID=America/Noronha:20190309T020000
DTSTAMP:19920901T130000Z
END:VEVENT
END:VCALENDAR
> convert
{
  "@type": "Group",
  "description": "We leave the timezones out but we use common names so that they are added.",
  "entries": [
    {
      "@type": "Event",
      "duration": "PT3H",
      "endTimeZone": "America/Los_Angeles",
      "iCalendar": {
        "convertedProperties": {
          "duration": {
            "name": "dtend"
          },
          "recurrenceOverrides/2024-09-13T06:00:00": {
            "parameters": {
              "tzid": "Europe/Berlin"
            }
          }
        },
        "name": "vevent"
      },
      "recurrenceOverrides": {
        "2024-09-13T06:00:00": {}
      },
      "start": "2014-08-29T08:00:00",
      "timeZone": "America/New_York",
      "title": "an event with a custom tz name"
    },
    {
      "@type": "Task",
      "due": "2014-08-29T08:00:00",
      "timeZone": "Asia/Singapore"
    },
    {
      "@type": "Event",
      "iCalendar": {
        "convertedProperties": {
          "recurrenceOverrides/2019-03-08T22:00:00": {
            "parameters": {
              "tzid": "America/Noronha"
            }
          },
          "recurrenceOverrides/2019-03-09T02:00:00": {
            "parameters": {
              "tzid": "Mexico/General"
            }
          }
        },
        "name": "vevent"
      },
      "recurrenceOverrides": {
        "2019-03-08T22:00:00": {},
        "2019-03-09T02:00:00": {}
      },
      "timeZone": "Mexico/General",
      "updated": "1992-09-01T13:00:00Z"
    },
    {
      "@type": "Event",
      "recurrenceId": "2019-03-09T02:00:00",
      "recurrenceIdTimeZone": "Europe/Moscow",
      "timeZone": "Europe/Moscow"
    }
  ]
}
> convert
BEGIN:VCALENDAR
DESCRIPTION:We leave the timezones out but we use common names so that they 
 are added.
BEGIN:VEVENT
DTSTART;TZID=America/New_York:20140829T080000
DTEND;TZID=America/Los_Angeles:20140829T080000
RDATE;TZID=Europe/Berlin:20240913T120000
SUMMARY:an event with a custom tz name
END:VEVENT
BEGIN:VTODO
DUE;TZID=Asia/Singapore:20140829T080000
END:VTODO
BEGIN:VEVENT
RDATE;TZID=America/Noronha:20190309T020000
RDATE;TZID=Mexico/General:20190309T020000
DTSTAMP:19920901T130000Z
END:VEVENT
BEGIN:VEVENT
RECURRENCE-ID;TZID=Europe/Moscow:20190309T020000
END:VEVENT
END:VCALENDAR

> test
DTSTART;TZID="W. Europe Standard Time":20241121T105302
> convert DTSTART property with a non-IANA TZID	parameter
"start": "2024-11-21T10:53:02",	
"timeZone": "Europe/Berlin",	
"iCalendar": {	
  "name": "vevent",	
  "convertedProperties": {	
    "start": {	
      "parameters": {	
        "tzid": "W. Europe Standard Time"	
      }	
    }	
  }	
}