function endFormCheck() {
var today = new Date();
var firstday = new Date(today.getFullYear(), today.getMonth(), 1);//1日を取得
var fiveday = new Date(today.getFullYear(), today.getMonth(), 5);//5日を取得
var today = Utilities.formatDate(today, "Asia/Tokyo", "yyyy-MM-dd");
var firstday = Utilities.formatDate(firstday, "Asia/Tokyo", "yyyy-MM-dd");
var fiveday = Utilities.formatDate(fiveday, "Asia/Tokyo", "yyyy-MM-dd");
var form = FormApp.getActiveForm();
//var LIMIT_COUNT = 3; //ここでカウント上限を設定
Logger.log(today);
Logger.log(firstday);
Logger.log(fiveday);
//if (form.getResponses().length >= LIMIT_COUNT) {
if (today >= firstday && today <= fiveday) {
form.setAcceptingResponses(true);
Logger.log("期間内");
}else{
form.setAcceptingResponses(false);
Logger.log("期間外");
//上記は、http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q11115562281を参考に作成
}
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme