gcalendr icon indicating copy to clipboard operation
gcalendr copied to clipboard

Calendar without events returns an error

Open brianmsm opened this issue 3 years ago • 0 comments

Hello I am using the package a lot, it is really super useful and I love it. However, I am having a problem (error) when I request events from a calendar on a date, and there are no events on it. I would like to find a way to return a data.frame with 0 rows (empty) or a function to check if there are events or not on a certain date (validation).

library(tidyverse)
library(gcalendr)

interes <- calendar_list() %>% 
  filter(str_detect(summary, "Vac")) 

calendar_events(interes$id[7],
                days_in_past = 0,
                days_in_future = 1,
                now = lubridate::ymd("2021-03-08"))
#> Reading calendar [email protected]
#> Error: Can't subset columns that don't exist.
#> x Column `summary` doesn't exist.

Created on 2021-03-04 by the reprex package (v1.0.0)

brianmsm avatar Mar 04 '21 17:03 brianmsm