For every calendar in GCal, it is possible to set the default reminder behavior for timed events and all day events.
For example, notify of an event scheduled for 3pm 10 minutes before it happens (2.50p).
For all day events, notify of an event scheduled for May 14, one day before at 8pm.
(These defaults can be modified/overwritten on a per event basis on GCAL.)
Now the bug is this: all-day events created by Dynalist do not honor the defaults set in GCAL and instead set a reminder for midnight of the scheduled day.
Timed events honor the GCAL default.
I canāt think of anything we do that would override default notifications, all day events are set in the exact same way as regular events (just with the timestamps set to 00:00 UTC).
I think instead of passing dateTime, you should pass a date.
end.date date The date, in the format "yyyy-mm-dd", if this is an all-day event.
end.dateTime datetime The time, as a combined date-time value (formatted according to RFC3339). A time zone offset is required unless a time zone is explicitly specified in timeZone.
Thatās exactly what Iām using. (Just the Java API instead of the JS API)
For reference in Java itās EventDateTime.setDateTime() vs EventDateTime.setDate() which we are correctly using depending on whether the event is an all-day event or not.
I have been reading through the google api.
I think you call
DateTime date = new DateTime("2020-01-01T00:00:00-00:00");
EventDateTime.setDate(date)
and this makes the google api confused.
Reading the docs for DateTime. I had the impression that if you want to use DateTime as a dateonly. you shold use this constructor:
public DateTime(boolean dateOnly,
long value,
Integer tzShift)
Instantiates DateTime, which may represent a date-only value, from the number of milliseconds since the Unix epoch, and a shift from UTC in minutes.
Parameters:
dateOnly - specifies if this should represent a date-only value
value - number of milliseconds since the Unix epoch (January 1, 1970, 00:00:00 GMT)
tzShift - time zone, represented by the number of minutes off of UTC, or null for TimeZone.getDefault().
From experimenting a bit, it seems that for me the all-day events get the notification defaults from the timed events as if the event time was midnight.
That is, if defaults for timed events are to have notifications 10 minutes and 20 minutes before the event,
an all day event event will get notification at 11.40p and 11.50p.