输出@sys.date_time值到Sheet

Output @sys.date_time value to the Sheet

首先,当我输入"Tomorrow noon"时,系统输出“2019-09-21T12:00:00+08:00”(参数:whattime)。当我输入"Tomorrow noon"这个词时,系统会把它转换成whatime: {"date_time": ""2019-09-21T12:00:00+08:00"}.

其次,输入一段时间的数据后才有时间显示。 (你可以查看我发布的这张图片)。 如何修复我的代码?

function saveDataHandler(agent){
    const{
      namelist, howmanypeople, whattime, forhere
    } = agent.parameters;
    const data = [{
      Name:namelist,
      Number:howmanypeople,
      Time:whattime[1],
      Forhere:forhere
    }];
    axios.post('.....it's about API', data);
  }

如果whattime值为whatime: {"date_time": "2019-09-21T12:00:00+08:00"},您应该在发送前在whatime中访问date_time

const{
      namelist, howmanypeople, whattime:{"date_time":dt}, forhere
    } = agent.parameters;//modified 
const data = [{
      Name:namelist,
      Number:howmanypeople,
      Time:dt.toString(),//modified
      Forhere:forhere
    }];

const{
      namelist, howmanypeople, whattime, forhere
    } = agent.parameters;
const data = [{
      Name:namelist,
      Number:howmanypeople,
      Time:whattime["date_time"].toString(),//modified
      Forhere:forhere
    }];

阅读: