{"id":1002,"date":"2020-01-26T08:00:19","date_gmt":"2020-01-25T23:00:19","guid":{"rendered":"https:\/\/google-apps-script.net\/instructions\/?p=1002"},"modified":"2021-02-18T05:57:08","modified_gmt":"2021-02-17T20:57:08","slug":"how-to-set-date-to-all-day-calendar-events-by-gas","status":"publish","type":"post","link":"https:\/\/for-dummies.net\/gas-noobs\/how-to-set-date-to-all-day-calendar-events-by-gas\/","title":{"rendered":"\u3010\u30b3\u30d4\u30da\u3067\u4f7f\u3048\u308b\u3011GAS\u3067\u4f5c\u6210\u6e08\u307f\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u306b\u5909\u66f4\u3057\u3066\u307f\u308b"},"content":{"rendered":"<h2>\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b&#8212; setAllDayDate()<\/h2>\n<p>\u4eca\u56de\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u65e2\u306b\u4f5c\u6210\u6e08\u306e\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u306b\u8a2d\u5b9a\u3059\u308b2\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u4eca\u56de\u306f\u4f3c\u305f\u3088\u3046\u306a\u30e1\u30bd\u30c3\u30c9\u304c2\u3064\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u4e00\u7dd2\u306b\u7d39\u4ecb\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u30021\u3064\u76ee\u306fsetAllDayDate()\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u3053\u3061\u3089\u306f\u65e2\u306b\u4f5c\u6210\u6e08\u307f\u306e\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u8907\u6570\u65e5\u306b\u307e\u305f\u304c\u308b\u4e88\u5b9a\u3067\u306f\u306a\u304f\u30011\u65e5\u306e\u7d42\u65e5\u4e88\u5b9a\u3068\u3057\u3066\u8a2d\u5b9a\u304c\u3067\u304d\u307e\u3059\u30022\u3064\u76ee\u306fsetAllDayDates()\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u3053\u3061\u3089\u3082\u540c\u3058\u3088\u3046\u306b\u4f5c\u6210\u6e08\u307f\u306e\u4e88\u5b9a\u3092\u5c31\u5b9f\u4e88\u5b9a\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u8907\u6570\u65e5\u306b\u307e\u305f\u304c\u308b\u7d42\u65e5\u4e88\u5b9a\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li><a href=\"#1\">setAllDayDate(date)<\/a><\/li>\n<li><a href=\"#2\">setAllDayDates(startDate, endDate)<\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h3>\u300e \u5f15\u6570\u306b\u5165\u308c\u308b\u5024 \u300f<\/h3>\n<ul class=\"typesquare_tags\">\n<li style=\"list-style-type: none;\">\n<ul class=\"typesquare_tags\">\n<li class=\"typesquare_tags\"><strong class=\"typesquare_tags\">date<\/strong>\uff08\u65e5\u306b\u3061\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09 \u2014 \u4e88\u5b9a\u8a2d\u5b9a\u65e5\u3092\u6307\u5b9a<\/li>\n<li><strong>startDate<\/strong>\uff08\u65e5\u306b\u3061\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u2014 \u4e88\u5b9a\u958b\u59cb\u65e5\u3092\u6307\u5b9a<\/li>\n<li><strong>endDate<\/strong>\uff08\u65e5\u306b\u3061\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09<strong>\u2014<\/strong> \u4e88\u5b9a\u7d42\u4e86\u65e5\u3092\u6307\u5b9a<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"1\">setAllDayDate(date)<\/h3>\n<div id=\"codeheader_js\" class=\"codeheader\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c91<\/div>\n<div id=\"codebox\">\n<pre>\/\/\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u306b\u8a2d\u5b9a\u3059\u308b\u30b3\u30fc\u30c9\nfunction sampleCodeForCalendarAppSetAllDayDate() {\n  var calendar = CalendarApp.getDefaultCalendar();\n  var date = new Date(); \n  var events = calendar.getEventsForDay(date);\n  for (var i in events) {\n    var event = events[i];\n    event.setAllDayDate(date);\n  }\n}<\/pre>\n<\/div>\n<h4>\u300e \u5909\u6570\u306e\u8aac\u660e \u300f<\/h4>\n<p><span class=\"variables\">calendar<\/span> = \u30c7\u30d5\u30a9\u30eb\u30c8\u30ab\u30ec\u30f3\u30c0\u30fc\u3092\u53d6\u5f97<br \/>\n<span class=\"variables\">date<\/span> = \u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u65e5\u3092\u4ee3\u5165<br \/>\n<span class=\"variables\">events<\/span> = \u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u65e5\u306e\u4e88\u5b9a\u3092\u53d6\u5f97<\/p>\n<h3 id=\"2\">setAllDayDates(startDate, endDate)<\/h3>\n<div id=\"codeheader_js\" class=\"codeheader\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c92<\/div>\n<div id=\"codebox\">\n<pre>\/\/\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u306b\u8a2d\u5b9a\u3059\u308b\u30b3\u30fc\u30c9\nfunction sampleCodeForCalendarAppSetAllDayDates() {\n  var calendar = CalendarApp.getDefaultCalendar();\n  var date = new Date(); \n  var events = calendar.getEventsForDay(date);\n  var startDate = new Date();\n  var endDate = new Date();\n  endDate.setDate(endDate.getDate() + 2);\n  for (var i in events) {\n    var event = events[i];\n    event.setAllDayDates(startDate, endDate);\n  }\n}<\/pre>\n<\/div>\n<h4>\u300e \u5909\u6570\u306e\u8aac\u660e \u300f<\/h4>\n<p><span class=\"variables\">calendar<\/span> = \u30c7\u30d5\u30a9\u30eb\u30c8\u30ab\u30ec\u30f3\u30c0\u30fc\u3092\u53d6\u5f97<br \/>\n<span class=\"variables\">date<\/span> = \u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u65e5\u3092\u4ee3\u5165<br \/>\n<span class=\"variables\">events<\/span> = \u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u65e5\u306e\u4e88\u5b9a\u3092\u53d6\u5f97<br \/>\n<span class=\"variables\">startDate<\/span> = \u4e88\u5b9a\u958b\u59cb\u65e5\u3092\u4ee3\u5165<br \/>\n<span class=\"variables\">endDate<\/span> = \u4e88\u5b9a\u7d42\u4e86\u65e5\u3092\u4ee3\u5165<\/p>\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u3067\u304d\u305f\u3089&#x25b6;\u30dc\u30bf\u30f3\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u4eca\u56de\u306e\u30b3\u30fc\u30c9\u3067\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u65e5\u306e\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u306b\u8a2d\u5b9a\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u305d\u306e\u65e5\u306b\u8a2d\u5b9a\u3057\u3066\u3042\u308b\u4e88\u5b9a\u304c\u3059\u3079\u3066\u7d42\u65e5\u4e88\u5b9a\u306b\u5909\u66f4\u3055\u308c\u305f\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u306b\u3059\u308b\u3068\u304d\u306f\u5143\u306e\u6642\u9593\u306b\u623b\u305b\u306a\u304f\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u5b9f\u884c\u524d\u306b\u4e88\u5b9a\u306e\u5185\u5bb9\u3092\u63a7\u3048\u3066\u304a\u304f\u304b\u3001\u30c6\u30b9\u30c8\u7528\u306e\u30ab\u30ec\u30f3\u30c0\u30fc\u3068\u4e88\u5b9a\u3092\u4f5c\u6210\u3057\u3066\u304b\u3089\u5b9f\u884c\u3059\u308b\u3053\u3068\u3092\u30aa\u30b9\u30b9\u30e1\u3057\u307e\u3059\u3002<\/p>\n<p>setAllDayDates()\u30e1\u30bd\u30c3\u30c9\u3067\u6ce8\u610f\u70b9\u304c1\u3064\u3042\u308a\u307e\u3059\u3002\u7d42\u4e86\u65e5\u306b\u8a2d\u5b9a\u3057\u305f\u6642\u9593\u306f\u8a2d\u5b9a\u3057\u305f\u65e5\u306e\u5348\u524d0\u6642\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u30012\u65e5\u306b\u6e21\u308b\u7d42\u65e5\u4e88\u5b9a\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u958b\u59cb\u65e5\u304b\u30892\u65e5\u5f8c\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u958b\u59cb\u65e5\u306b2020\u5e741\u67081\u65e5\u3092\u8a2d\u5b9a\u3057\u305f\u3068\u3057\u3066\u30012020\u5e741\u67082\u65e5\u307e\u3067\u306e\u7d42\u65e5\u4e88\u5b9a\u3092\u4f5c\u6210\u3057\u305f\u3044\u5834\u5408\u3001startDate\u306b\u306f2020\u5e741\u67081\u65e5\u3092\u6307\u5b9a\u3057\u3001endDate\u306b\u306f2020\u5e741\u67083\u65e5\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u70b9\u30011\u65e5\u30d7\u30e9\u30b9\u3059\u308b\u3060\u3051\u3067\u306f\u306a\u3044\u3053\u3068\u306b\u7559\u610f\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/for-dummies.net\/gas-noobs\/wp-content\/uploads\/2020\/01\/allDayEventImage-1.jpeg?ssl=1\" target=\"_blank\" rel=\"noopener\"><img class=\"border aligncenter wp-image-1007 size-medium\" src=\"https:\/\/i1.wp.com\/for-dummies.net\/gas-noobs\/wp-content\/uploads\/2020\/01\/allDayEventImage-1.jpeg?resize=300%2C150&#038;ssl=1\" alt=\"\u7d42\u65e5\u4e88\u5b9a\u306e\u30a4\u30e1\u30fc\u30b8\" width=\"300\" height=\"150\" srcset=\"https:\/\/i1.wp.com\/for-dummies.net\/gas-noobs\/wp-content\/uploads\/2020\/01\/allDayEventImage-1.jpeg?resize=300%2C150&amp;ssl=1 300w, https:\/\/i1.wp.com\/for-dummies.net\/gas-noobs\/wp-content\/uploads\/2020\/01\/allDayEventImage-1.jpeg?resize=304%2C152&amp;ssl=1 304w, https:\/\/i1.wp.com\/for-dummies.net\/gas-noobs\/wp-content\/uploads\/2020\/01\/allDayEventImage-1.jpeg?resize=282%2C141&amp;ssl=1 282w, https:\/\/i1.wp.com\/for-dummies.net\/gas-noobs\/wp-content\/uploads\/2020\/01\/allDayEventImage-1.jpeg?w=500&amp;ssl=1 500w\" sizes=\"(max-width: 300px) 100vw, 300px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30fc\u3057\u3066\u5b9f\u884c\u3057\u305f\u3042\u3068\u306b\u3054\u81ea\u8eab\u306e\u30ab\u30ec\u30f3\u30c0\u30fc\u3092\u958b\u3044\u3066\u4e88\u5b9a\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3082\u3057\u3059\u3067\u306b\u30ab\u30ec\u30f3\u30c0\u30fc\u3092\u958b\u3044\u3066\u3044\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u5f8c\u3082\u4e88\u5b9a\u304c\u7d42\u65e5\u4e88\u5b9a\u306b\u306a\u3063\u3066\u3044\u306a\u3051\u308c\u3070\u3001\u4e00\u5ea6\u30da\u30fc\u30b8\u3092\u30ea\u30ed\u30fc\u30c9\u3057\u3066\u78ba\u8a8d\u3057\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u4eca\u56de\u306f\u3059\u3067\u306b\u4f5c\u6210\u6e08\u307f\u306e\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u306b\u8a2d\u5b9a\u3059\u308bsetAllDayDate()\u30e1\u30bd\u30c3\u30c9\u3068setAllDayDates()\u306e\u3054\u7d39\u4ecb\u3092\u3057\u307e\u3057\u305f\u3002\u65e2\u5b58\u306e\u30b9\u30dd\u30c3\u30c8\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u3078\u5207\u308a\u66ff\u3048\u308b\u3084\u308a\u65b9\u3082\u7fd2\u5f97\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u3082\u3046CalendarApp\u3092\u5229\u7528\u3057\u305f\u30b3\u30fc\u30c9\u306f\u4f55\u3067\u3082\u304b\u3051\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b&#8212; setAllDayDate() \u4eca\u56de\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u65e2\u306b\u4f5c\u6210\u6e08\u306e\u4e88\u5b9a\u3092\u7d42\u65e5\u4e88\u5b9a\u306b\u8a2d\u5b9a\u3059\u308b2\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":1346,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","spay_email":"","jetpack_publicize_message":"\u3010GAS\u3011setAllDayDate\u30e1\u30bd\u30c3\u30c9\u3068setAllDayDates\u30e1\u30bd\u30c3\u30c9\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\r\n\u65e2\u5b58\u4e88\u5b9a\u3092\u5c31\u5b9f\u4e88\u5b9a\u306b\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\r\n#GAS #GoogleAppsScript #CalendarApp #setAllDayDate #setAllDayDates","jetpack_is_tweetstorm":false},"categories":[4,16,80,3],"tags":[66,53,52,55,50],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/for-dummies.net\/gas-noobs\/wp-content\/uploads\/2020\/01\/CalendarApp_setAllDayDate-1.png?fit=320%2C180&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9Z92k-ga","jetpack_likes_enabled":true,"amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/posts\/1002"}],"collection":[{"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/comments?post=1002"}],"version-history":[{"count":6,"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/posts\/1002\/revisions"}],"predecessor-version":[{"id":2168,"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/posts\/1002\/revisions\/2168"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/media\/1346"}],"wp:attachment":[{"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/media?parent=1002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/categories?post=1002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/for-dummies.net\/gas-noobs\/wp-json\/wp\/v2\/tags?post=1002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}