Skip to content

Commit

Permalink
More Improvements to Multi-Day Event Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo authored Feb 9, 2017
1 parent c7ac975 commit 78d596b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/freebusy.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,14 @@

} else if (eventEnd.diff(eventStart, 'days') > 0) { // is multi-day event WITH time

eventDuration = eventStart.format("ddd, MMMM Do (h:mm a)") + " until " + eventEnd.format("dddd, MMMM Do (h:mm a)");
if (eventEnd.format("ddd") == "Fri" && eventEnd.hour() >= 17) {
console.log("Hey!");
eventEnd.add(2, "days");
} else if (eventEnd.format("ddd") == "Sat") {
eventEnd.add(1, "days");
}

eventDuration = "Back on " + eventEnd.format("ddd, MMMM Do (h:mm a)");

} else if ((eventStart.hour() <= 8) && (eventEnd.hour() >= 17)) { // event is sometime before 9 until sometime after 5

Expand Down

0 comments on commit 78d596b

Please sign in to comment.