サードパーティのソースから差し込み印刷スクリプトをコピーして貼り付けました。1つのことを除いて、それは素晴らしく機能します。
フォームに日付を入力すると (例: 2012 年 7 月 7 日)、差し込み印刷のスクリプトが日付を日付変更線に変換します (例: 2012 年 7 月 7 日 00:00:00 GMT)。
日付以降の不要な日付を削除したい。手伝って頂けますか?
この問題に最も関連するコードの部分は次のとおりです。 // 現在のタイムスタンプとタイムゾーンを設定します。timeZone = myVariablesSheet.getRange("B13").getValue(); dateline = myVariablesSheet.getRange("B7").getValue();
if(typeof timeZone == 'undefined' || timeZone == '') {
timeZone = 'GMT';
}
if(typeof dateline == 'undefined' || dateline == '') {
dateline = Utilities.formatDate(new Date(), timeZone, "EEE, MMM d, ''yy");
} else {
dateline = Utilities.formatDate(dateline, timeZone, "EEE, MMM d, ''yy");
}
if(debug) Browser.msgBox("dateline = " + dateline + "\ntimeZone = " + timeZone);