【发布时间】:2021-10-27 15:36:52
【问题描述】:
在下面的代码中,我喜欢重新格式化日期,即每个内部数组中的第一个元素,以便像使用 Google Apps 脚本在输出中一样获取它们。我怎样才能做到这一点?谢谢!
function test() {
const input = [['Fri Oct 15 2021 00:00:00 GMT-0400 (Eastern Daylight Time)', 123.19],
['Thu Oct 14 2021 00:00:00 GMT-0400 (Eastern Daylight Time)', 122.83]];
// How should this code be changed to reformat the dates in each inner array to get the output like below
var output = input.map(el => el);
// output = [['Oct 15, 2021', 123.19],
// ['Oct 14, 2021', 122.83]];
}
【问题讨论】:
标签: google-apps-script date-format