Created
April 21, 2020 10:57
-
-
Save nyawach/f1b5487c19c0be96a027bedfb710d537 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @return {Boolean} 祝日かどうか | |
*/ | |
function isJapaneseHoliday() { | |
var startDate = new Date(); | |
startDate.setHours(0, 0, 0, 0); | |
var endDate = new Date(); | |
endDate.setHours(23, 59, 59, 999); | |
// google calenderの提供している祝日カレンダーを取得する | |
var cal = CalendarApp.getCalendarById("ja.japanese#[email protected]"); | |
var holidays = cal.getEvents(startDate, endDate); | |
return holidays.length !== 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment