Open Robinlovelace opened 5 years ago
@Robinlovelace I found this same error in a different context for ic_write
. Reprex below.
spurs_games = tibble::tribble(
~BEGIN, ~PRODID, ~VERSION, ~CALSCALE, ~METHOD, ~UID, ~DTSTART, ~DTEND, ~SUMMARY, ~LOCATION, ~END,
"VCALENDAR", "-//ATFutures/ical //EN", "2.0", "GREGORIAN", "PUBLISH", "ical-1722515a-dd8b-4608-aa31-12a208a6903b", "20241030T203000", "20241030T230000", "Spurs at Thunder", "ESPN", "VEVENT",
"VCALENDAR", "-//ATFutures/ical //EN", "2.0", "GREGORIAN", "PUBLISH", "ical-4d12e9a2-d287-498f-a160-f53a81ed92ed", "20241031T200000", "20241031T223000", "Spurs at Jazz", "NBA Team Pass", "VEVENT"
) |>
calendar::ic_write(file = "temp.ics")
#> Warning in calendar::ic_write(tibble::tribble(~BEGIN, ~PRODID, ~VERSION, :
#> Coercing ic to an ical object. Use ical() first to set custom attributes.
#> Error in format.POSIXct(x, "%Y%m%d"): wrong class
Created on 2024-10-20 with reprex v2.1.1
It's possible that part of the issue is that .ics
requires a certain format (see stackoverflow post), e.g., there's only one VCALENDAR and multiple VEVENTs; although this may be resolved by ic_write
.
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//bobbin v0.1//NONSGML iCal Writer//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
DTSTART:20100701T080000Z
DTEND:20100701T110000Z
END:VEVENT
BEGIN:VEVENT
DTSTART:20100701T120000Z
DTEND:20100701T130000Z
END:VEVENT
END:VCALENDAR
Thanks for the comment @math-mcshane. Sorry but I don't have time to work on a fix, if you or anyone figures out a fix, input/suggestions are welcome.
e.g.:
Created on 2019-03-13 by the reprex package (v0.2.1)