Skip to content

Commit

Permalink
Add Support for "Use Name"/"Use Title" Flag
Browse files Browse the repository at this point in the history
Based on a feature request. If a calendar event has "Use Name" or "Use Title" in the _description_ of the event, then the in/out board will show the name instead of the location. This is useful if, for example, the location of the event is "Joe's Urology, 1234 Medical Lane" but you don't want that to be displayed on the board. Enter the event's title as "Doctors Appointment" and description as "Use Title" and the board will display that instead.
  • Loading branch information
Leo authored Dec 12, 2017
1 parent 55e7072 commit e775b08
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/freebusy.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@

var eventName = freeBusyDetails.eventDetails.name;
var eventLocation = freeBusyDetails.eventDetails.location;
var eventDescription = freeBusyDetails.eventDetails.description;
var eventStart = freeBusyDetails.eventDetails.startTime;
var eventEnd = freeBusyDetails.eventDetails.endTime;
var isMarkedAsAllDayEvent = freeBusyDetails.eventDetails.allDay;
Expand Down Expand Up @@ -208,7 +209,12 @@
personsName = "🏋 " + personsName;
break;
}


if (eventDescription &&
(eventDescription.toLowerCase().includes("use name") || eventDescription.toLowerCase().includes("use title"))) {
eventLocation = eventName;
}

if (!eventLocation) {
eventLocation = eventName;
}
Expand Down

0 comments on commit e775b08

Please sign in to comment.