Hi, I am trying to do something simple, I think. I want to create a new calendar entry where the title is the current date (2022-12-16) and the description / notes are what are in the current draft. However, I get an error, unexpected token %. Any thoughts on how to fix?
var cal = Calendar.find(“Life Log”);
var event = cal.createEvent();
var title = [[date|%Y-%m-%d]];
event.title = title;
event.notes = ‘From Drafts App’ + ‘\n’ + draft.processTemplate(“[[body]]”);;
event.startDate = draft.createdAt;
event.endDate = draft.createdAt;
event.location = draft.createdLatitude + ‘,’ + draft.createdLongitude;
event.isAllDay = true;
if (!event.update()) {
console.log(event.lastError);
}