calendar icon indicating copy to clipboard operation
calendar copied to clipboard

Collect a list of example calendars to test on

Open Robinlovelace opened this issue 6 years ago • 6 comments

Eventually these can go into the tests but for now good enough is just to list them.

So far we have:

  • One on holidays in the UK: https://www.gov.uk/bank-holidays/england-and-wales.ics

  • A calendar from Google with a single simple event: https://calendar.google.com/calendar/ical/9sl1qu3qh2vdnq26bjgvtnos94%40group.calendar.google.com/private-85cbe5d781da1b7efc91e01032cfc264/basic.ics

  • My work calendar: https://outlook.office365.com/owa/calendar/[email protected]/32e1cb4137f4414b8d7644453ec4b10414316826143036893453/calendar.ics

Any others people find, please add links in comments below.

Robinlovelace avatar Aug 12 '18 20:08 Robinlovelace

OK this should keep us busy for a while and ensure pretty good coverage: https://github.com/mozilla-comm/ical.js/tree/master/samples

Robinlovelace avatar Aug 12 '18 20:08 Robinlovelace

It now reads-in my calendar - some of the fields are not formatted right, but this is major progress: we can read-in calendars from the wild: https://atfutures.github.io/ical/#trying-on-calendars-in-the-wild

@mpadge and @layik can you please try to find calendars that break ic_read()?

Next priority I think is to sort out all the different types of timestamp, the output in the above example is in character format and is a mess! Hence restricting the output to:

c("DESCRIPTION", "SUMMARY", "DTSTART", "DTEND", "STATUS", "SEQUENCE", "LOCATION")

Robinlovelace avatar Aug 14 '18 09:08 Robinlovelace

In case it helps, I've got a standalone C++ lib that coverts almost any arbitrarily messy timestamps to standard format: https://github.com/mpadge/cpp-datetime-convert

mpadge avatar Aug 14 '18 13:08 mpadge

I think so++

Robinlovelace avatar Aug 14 '18 14:08 Robinlovelace

May be overkill though. If you could demo how it would deal with these text strings that would be awesome - it's good it can handle mess as ical timestamps seem messy to me:

ical::ical_example[c(7, 9, 15)]
#> [1] "X-WR-TIMEZONE:Europe/London"    "DTSTART:20180809T160000Z"      
#> [3] "LAST-MODIFIED:20180807T133712Z"
ical::ical_outlook[[2]][c(7, 11)]
#> [1] "DTSTART;TZID=GMT Standard Time:20180515T100000"
#> [2] "DTSTAMP:20180814T134259Z"

Created on 2018-08-14 by the reprex package (v0.2.0).

Robinlovelace avatar Aug 14 '18 14:08 Robinlovelace

Note: slightly less messy text strings can be accessed as follows (note: ic_vector() unhelpfully removes the timezone value - that's a new one for me, hence the X):

ical::ic_vector(ical::ical_example[c(7, 9, 15)])
#>            DTSTART      LAST-MODIFIED 
#> "20180809T160000Z" "20180807T133712Z"
ical::ic_vector(ical::ical_outlook[[2]][c(7, 11)])
#> DTSTART;TZID=GMT Standard Time                        DTSTAMP 
#>              "20180515T100000"             "20180814T134259Z"

Created on 2018-08-14 by the reprex package (v0.2.0).

Robinlovelace avatar Aug 14 '18 14:08 Robinlovelace