Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created April 17, 2019 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/53f033a79cc8f921947b9e8358c4825f to your computer and use it in GitHub Desktop.
Save iaindooley/53f033a79cc8f921947b9e8358c4825f to your computer and use it in GitHub Desktop.
Google calendar with label colours
function createOrUpdateNewEventForDueDateAdded(notification)
{
//Also fires for updated due date
var card = new Notification(notification).addedDueDate().card();
createOrUpdateEventLinkedtoCard(card);
}
function updateLabelColour(notification)
{
var label = new Notification(notification).addedLabel();
setEventColourFromAddedLabel(label);
}
/**
* Create an event if one doesn't exist
* and add event ID to the Calendar Event ID
* custom field value on the card.
*
* If that field value already exists, update the
* event to the due date of the card, and update
* the label colour
*/
function createOrUpdateEventLinkedtoCard(card)
{
//NEEDS WORK ON CALENDAR API
}
/**
* Find the event linked to the card a
* label was added to, and set the event
* colour to that label
*/
function setEventColourFromLabel(label)
{
//NEEDS WORK ON CALENDAR API
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment