多年来每天或每周自动添加一行(使用脚本或函数?)
Add a row per day or week automatically for multiple years (w/ using script or function ?)
我想做的是创建一个脚本或具有自动添加每行的日、月和年的功能,例如 4 年,以便制作拍摄日历、预制作每部电影 post prod。手动完成并在 4 年或更长时间内每月添加每一天会很长。如果它是通过脚本完成的,它将立即完成,并且可以在以后更新以增加更多年份。
我正在寻找的示例
如果每天太复杂,我可以每周添加。比如 1 月 21 日第 1 周,就像图片中那样。但我真的更喜欢每天添加一行以尽可能准确。
列中一年中剩余天数
function daysforrestofyear() {
let days = [];
let dt = new Date();
const ldtv = new Date(dt.getFullYear() + 1,0,1).valueOf();
do {
days.push([Utilities.formatDate(dt,Session.getScriptTimeZone(),"dd/MMM/yyyy")]);
dt.setDate(dt.getDate() + 1);
}while(dt.valueOf() < ldtv)
const ss = SpreadsheetApp.getActive();
const sh = ss.getSheetByName("Sheet0");
sh.clearContents();
sh.getRange(1,1,days.length,1).setValues(days);
}
Jun/04/2022
Jun/05/2022
Jun/06/2022
Jun/07/2022
Jun/08/2022
Jun/9/2022
Jun/10/2022
Jun/11/2022
Jun/12/2022
Jun/13/2022
Jun/14/2022
Jun/15/2022
Jun/16/2022
Jun/17/2022
Jun/18/2022
Jun/19/2022
Jun/20/2022
Jun/21/2022
Jun/22/2022
Jun/23/2022
Jun/24/2022
Jun/25/2022
Jun/26/2022
Jun/27/2022
Jun/28/2022
Jun/29/2022
Jun/30/2022
Jul/01/2022
Jul/02/2022
Jul/03/2022
Jul/04/2022
Jul/05/2022
Jul/06/2022
Jul/07/2022
Jul/08/2022
Jul/9/2022
Jul/10/2022
Jul/11/2022
Jul/12/2022
Jul/13/2022
Jul/14/2022
Jul/15/2022
Jul/16/2022
Jul/17/2022
Jul/18/2022
Jul/19/2022
Jul/20/2022
Jul/21/2022
Jul/22/2022
Jul/23/2022
Jul/24/2022
Jul/25/2022
Jul/26/2022
Jul/27/2022
Jul/28/2022
Jul/29/2022
Jul/30/2022
Jul/31/2022
Aug/01/2022
Aug/02/2022
Aug/03/2022
Aug/04/2022
Aug/05/2022
Aug/06/2022
Aug/07/2022
Aug/08/2022
Aug/9/2022
Aug/10/2022
Aug/11/2022
Aug/12/2022
Aug/13/2022
Aug/14/2022
Aug/15/2022
Aug/16/2022
Aug/17/2022
Aug/18/2022
Aug/19/2022
Aug/20/2022
Aug/21/2022
Aug/22/2022
Aug/23/2022
Aug/24/2022
Aug/25/2022
Aug/26/2022
Aug/27/2022
Aug/28/2022
Aug/29/2022
Aug/30/2022
Aug/31/2022
Sep/01/2022
Sep/02/2022
Sep/03/2022
Sep/04/2022
Sep/05/2022
Sep/06/2022
Sep/07/2022
Sep/08/2022
Sep/9/2022
Sep/10/2022
Sep/11/2022
Sep/12/2022
Sep/13/2022
Sep/14/2022
Sep/15/2022
Sep/16/2022
Sep/17/2022
Sep/18/2022
Sep/19/2022
Sep/20/2022
Sep/21/2022
Sep/22/2022
Sep/23/2022
Sep/24/2022
Sep/25/2022
Sep/26/2022
Sep/27/2022
Sep/28/2022
Sep/29/2022
Sep/30/2022
Oct/01/2022
Oct/02/2022
Oct/03/2022
Oct/04/2022
Oct/05/2022
Oct/06/2022
Oct/07/2022
Oct/08/2022
Oct/9/2022
Oct/10/2022
Oct/11/2022
Oct/12/2022
Oct/13/2022
Oct/14/2022
Oct/15/2022
Oct/16/2022
Oct/17/2022
Oct/18/2022
Oct/19/2022
Oct/20/2022
Oct/21/2022
Oct/22/2022
Oct/23/2022
Oct/24/2022
Oct/25/2022
Oct/26/2022
Oct/27/2022
Oct/28/2022
Oct/29/2022
Oct/30/2022
Oct/31/2022
Nov/01/2022
Nov/02/2022
Nov/03/2022
Nov/04/2022
Nov/05/2022
Nov/06/2022
Nov/07/2022
Nov/08/2022
Nov/9/2022
Nov/10/2022
Nov/11/2022
Nov/12/2022
Nov/13/2022
Nov/14/2022
Nov/15/2022
Nov/16/2022
Nov/17/2022
Nov/18/2022
Nov/19/2022
Nov/20/2022
Nov/21/2022
Nov/22/2022
Nov/23/2022
Nov/24/2022
Nov/25/2022
Nov/26/2022
Nov/27/2022
Nov/28/2022
Nov/29/2022
Nov/30/2022
Dec/01/2022
Dec/02/2022
Dec/03/2022
Dec/04/2022
Dec/05/2022
Dec/06/2022
Dec/07/2022
Dec/08/2022
Dec/9/2022
Dec/10/2022
Dec/11/2022
Dec/12/2022
Dec/13/2022
Dec/14/2022
Dec/15/2022
Dec/16/2022
Dec/17/2022
Dec/18/2022
Dec/19/2022
Dec/20/2022
Dec/21/2022
Dec/22/2022
Dec/23/2022
Dec/24/2022
Dec/25/2022
Dec/26/2022
Dec/27/2022
Dec/28/2022
Dec/29/2022
Dec/30/2022
Dec/31/2022
我想做的是创建一个脚本或具有自动添加每行的日、月和年的功能,例如 4 年,以便制作拍摄日历、预制作每部电影 post prod。手动完成并在 4 年或更长时间内每月添加每一天会很长。如果它是通过脚本完成的,它将立即完成,并且可以在以后更新以增加更多年份。
我正在寻找的示例
如果每天太复杂,我可以每周添加。比如 1 月 21 日第 1 周,就像图片中那样。但我真的更喜欢每天添加一行以尽可能准确。
列中一年中剩余天数
function daysforrestofyear() {
let days = [];
let dt = new Date();
const ldtv = new Date(dt.getFullYear() + 1,0,1).valueOf();
do {
days.push([Utilities.formatDate(dt,Session.getScriptTimeZone(),"dd/MMM/yyyy")]);
dt.setDate(dt.getDate() + 1);
}while(dt.valueOf() < ldtv)
const ss = SpreadsheetApp.getActive();
const sh = ss.getSheetByName("Sheet0");
sh.clearContents();
sh.getRange(1,1,days.length,1).setValues(days);
}
Jun/04/2022 |
---|
Jun/05/2022 |
Jun/06/2022 |
Jun/07/2022 |
Jun/08/2022 |
Jun/9/2022 |
Jun/10/2022 |
Jun/11/2022 |
Jun/12/2022 |
Jun/13/2022 |
Jun/14/2022 |
Jun/15/2022 |
Jun/16/2022 |
Jun/17/2022 |
Jun/18/2022 |
Jun/19/2022 |
Jun/20/2022 |
Jun/21/2022 |
Jun/22/2022 |
Jun/23/2022 |
Jun/24/2022 |
Jun/25/2022 |
Jun/26/2022 |
Jun/27/2022 |
Jun/28/2022 |
Jun/29/2022 |
Jun/30/2022 |
Jul/01/2022 |
Jul/02/2022 |
Jul/03/2022 |
Jul/04/2022 |
Jul/05/2022 |
Jul/06/2022 |
Jul/07/2022 |
Jul/08/2022 |
Jul/9/2022 |
Jul/10/2022 |
Jul/11/2022 |
Jul/12/2022 |
Jul/13/2022 |
Jul/14/2022 |
Jul/15/2022 |
Jul/16/2022 |
Jul/17/2022 |
Jul/18/2022 |
Jul/19/2022 |
Jul/20/2022 |
Jul/21/2022 |
Jul/22/2022 |
Jul/23/2022 |
Jul/24/2022 |
Jul/25/2022 |
Jul/26/2022 |
Jul/27/2022 |
Jul/28/2022 |
Jul/29/2022 |
Jul/30/2022 |
Jul/31/2022 |
Aug/01/2022 |
Aug/02/2022 |
Aug/03/2022 |
Aug/04/2022 |
Aug/05/2022 |
Aug/06/2022 |
Aug/07/2022 |
Aug/08/2022 |
Aug/9/2022 |
Aug/10/2022 |
Aug/11/2022 |
Aug/12/2022 |
Aug/13/2022 |
Aug/14/2022 |
Aug/15/2022 |
Aug/16/2022 |
Aug/17/2022 |
Aug/18/2022 |
Aug/19/2022 |
Aug/20/2022 |
Aug/21/2022 |
Aug/22/2022 |
Aug/23/2022 |
Aug/24/2022 |
Aug/25/2022 |
Aug/26/2022 |
Aug/27/2022 |
Aug/28/2022 |
Aug/29/2022 |
Aug/30/2022 |
Aug/31/2022 |
Sep/01/2022 |
Sep/02/2022 |
Sep/03/2022 |
Sep/04/2022 |
Sep/05/2022 |
Sep/06/2022 |
Sep/07/2022 |
Sep/08/2022 |
Sep/9/2022 |
Sep/10/2022 |
Sep/11/2022 |
Sep/12/2022 |
Sep/13/2022 |
Sep/14/2022 |
Sep/15/2022 |
Sep/16/2022 |
Sep/17/2022 |
Sep/18/2022 |
Sep/19/2022 |
Sep/20/2022 |
Sep/21/2022 |
Sep/22/2022 |
Sep/23/2022 |
Sep/24/2022 |
Sep/25/2022 |
Sep/26/2022 |
Sep/27/2022 |
Sep/28/2022 |
Sep/29/2022 |
Sep/30/2022 |
Oct/01/2022 |
Oct/02/2022 |
Oct/03/2022 |
Oct/04/2022 |
Oct/05/2022 |
Oct/06/2022 |
Oct/07/2022 |
Oct/08/2022 |
Oct/9/2022 |
Oct/10/2022 |
Oct/11/2022 |
Oct/12/2022 |
Oct/13/2022 |
Oct/14/2022 |
Oct/15/2022 |
Oct/16/2022 |
Oct/17/2022 |
Oct/18/2022 |
Oct/19/2022 |
Oct/20/2022 |
Oct/21/2022 |
Oct/22/2022 |
Oct/23/2022 |
Oct/24/2022 |
Oct/25/2022 |
Oct/26/2022 |
Oct/27/2022 |
Oct/28/2022 |
Oct/29/2022 |
Oct/30/2022 |
Oct/31/2022 |
Nov/01/2022 |
Nov/02/2022 |
Nov/03/2022 |
Nov/04/2022 |
Nov/05/2022 |
Nov/06/2022 |
Nov/07/2022 |
Nov/08/2022 |
Nov/9/2022 |
Nov/10/2022 |
Nov/11/2022 |
Nov/12/2022 |
Nov/13/2022 |
Nov/14/2022 |
Nov/15/2022 |
Nov/16/2022 |
Nov/17/2022 |
Nov/18/2022 |
Nov/19/2022 |
Nov/20/2022 |
Nov/21/2022 |
Nov/22/2022 |
Nov/23/2022 |
Nov/24/2022 |
Nov/25/2022 |
Nov/26/2022 |
Nov/27/2022 |
Nov/28/2022 |
Nov/29/2022 |
Nov/30/2022 |
Dec/01/2022 |
Dec/02/2022 |
Dec/03/2022 |
Dec/04/2022 |
Dec/05/2022 |
Dec/06/2022 |
Dec/07/2022 |
Dec/08/2022 |
Dec/9/2022 |
Dec/10/2022 |
Dec/11/2022 |
Dec/12/2022 |
Dec/13/2022 |
Dec/14/2022 |
Dec/15/2022 |
Dec/16/2022 |
Dec/17/2022 |
Dec/18/2022 |
Dec/19/2022 |
Dec/20/2022 |
Dec/21/2022 |
Dec/22/2022 |
Dec/23/2022 |
Dec/24/2022 |
Dec/25/2022 |
Dec/26/2022 |
Dec/27/2022 |
Dec/28/2022 |
Dec/29/2022 |
Dec/30/2022 |
Dec/31/2022 |