[英]Increment 7 days to a date in Google Sheets
我的目標解釋:通過按我的谷歌表格中的按鈕,將 7 天添加到單元格中當前存在的日期。
當前發生的情況:當我按下運行我的腳本而不是添加 7 天時,它只是在結束時寫入 7。
我的腳本:
function IncrementW() {
var spreadsheet = SpreadsheetApp.getActive();
SpreadsheetApp.getActiveSheet().getActiveCell().setValue(SpreadsheetApp.getActiveSheet().getActiveCell().getValue() + 7);
};
output 給了我什么:
From: 7/12/2020 to >> Sun Jul 12 2020 00:00:00 GMT-0400 (Eastern Daylight Time)7
我的 output 應該是:
From: 7/12/2020 to >> 7/19/2020
感謝您的幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.