ATFutures / calendar

R interface to iCal (.ics files)
https://atfutures.github.io/calendar/
Other
41 stars 10 forks source link

cannot create all day event #35

Closed rodrigoesborges closed 5 years ago

rodrigoesborges commented 5 years ago

I tried to create all day event, which , as per this info , for example, should have DTSTART and DTEND values as VALUE=DATE:YYYYmmdd

I couldn't generate the events with proper values for DTSTART and END

I tried also to modify by hand the results, before writing to ics. But then write.ics() failed

layik commented 5 years ago

Hi @rodrigoesborges

library(calendar)
s <- lubridate::ymd_h("2019-05-07 00")
ic <- ic_event(start_time = s, end_time = 0)
class(ic)
#> [1] "ical"       "tbl_df"     "tbl"        "data.frame"
if(is(ic, "ical")) {
  ic_write(ic, "github.ics")
  readLines("github.ics")
}
#>  [1] "BEGIN:VCALENDAR"                              
#>  [2] "PRODID:-//ATFutures/ical //EN"                
#>  [3] "VERSION:2.0"                                  
#>  [4] "CALSCALE:GREGORIAN"                           
#>  [5] "METHOD:PUBLISH"                               
#>  [6] "BEGIN:VEVENT"                                 
#>  [7] "UID:ical-034387b6-e539-4bfa-8fe3-78405f79c59c"
#>  [8] "DTSTART:20190507T000000"                      
#>  [9] "DTEND:20190507T000000"                        
#> [10] "SUMMARY:ical event"                           
#> [11] "END:VEVENT"                                   
#> [12] "END:VCALENDAR"

Created on 2019-05-07 by the reprex package (v0.2.1)

Am I missing something? Did you miss some date syntax? Let us know.

Robinlovelace commented 5 years ago

Any update on this @rodrigoesborges? There is some work to be done on this package for sure so any input welcome.

rodrigoesborges commented 5 years ago

Sorry for the late response, and for opening the issue. I had probably some error on my previous handling of date formats. @layik code adapted to my tests worked flawlessly.

Robinlovelace commented 5 years ago

No problem, thanks for follow-up.