Appmaker:Google表格返回的日期有误

时间:2019-12-11 10:14:03

标签: google-app-maker

我在appmaker中制作了一个脚本,该脚本采用了插入Google表格并显示在appmaker中的日期。日期提前一天,如果我在Google表格10-08-2018中插入,它将进入appmaker 2018-10-07  我不知道为什么?!

这是appmaker中的代码:

function getCellValue(spreadsheetId, sheetName, cellRange) {
  var range = getRange_(spreadsheetId, sheetName, cellRange);

  return JSON.stringify(range.getValue());
}

function createAutoTickets(widget) {
var jsonResultDATE = getCellValue(sheet.sheet_id, getSheets(sheet.sheet_id), 'B' + ii.toString());
var newRecord = app.models.AymanTickets.newRecord();
            console.info(jsonResultDATE.substr(1, 10));
            newRecord.ticket_date = new Date(jsonResultDATE.substr(1, 10));
 app.saveRecords([newRecord]); 
}

整个脚本代码https://docs.google.com/document/d/1jMTHIzK7nIVR2kgBpmwFdYVitnV-8p8Njm9RT6TGHyE/edit?usp=sharing

0 个答案:

没有答案