Skip to content

Instantly share code, notes, and snippets.

@kakakaya
Created December 9, 2015 08:25
Show Gist options
  • Save kakakaya/3ef4e690af05695d12cf to your computer and use it in GitHub Desktop.
Save kakakaya/3ef4e690af05695d12cf to your computer and use it in GitHub Desktop.
怪文書
// -*- mode:js2; coding:utf-8 -*-
// Created: Wed Dec 9 17:00:55 2015
function isXmasBusy() {
var calendars = CalendarApp.getAllOwnedCalendars();
var xmas_eve = new Date(2015, 11,24);
var xmas = new Date(2015, 11, 25);
for (i=0,len=calendars.length;i!=len;i++) {
var calendar = calendars[i];
if (calendar.getEventsForDay(xmas_eve).length != 0 ||
calendar.getEventsForDay(xmas).length != 0) {
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment