The Obsidian Google Calendar API allows you to create events on you own. The function createEvent
is publicly exposed so codeblocks from Templater or Dataview can access it.
Usage
The argument of the createEvent
function is a GoogleEvent object.
This object has to contain the required fields listed in the Google Calendar API documentation.
To define the calendar where the event is created add a field parent
containing a GoogleCalendar object.
If no parent field is set the functions uses the DefaultCalendar.
Example
<%*
const {createEvent} = this.app.plugins.plugins["google-calendar"].api;
await createEvent({
summary: "Test event",
start: {
date: window.moment()
},
end: {
date: window.moment()
}
});
%>