小程序 new Date(2019-03-01 00:00:00) 返回对象null

IOS只识别 2019-03-01 这样的日期格式, 不支持 2019-03-01 00:00:00

用正则替换2019-03-01日期格式为2019/03/01后问题解决

  let newDate = (date).replace(/-/g, '/');
  return new Date(newDate);

 

posted @ 2019-03-18 12:29  李里ly  阅读(1763)  评论(0编辑  收藏  举报