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

时间:2019-03-18 13:21:54   收藏:0   阅读:348

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);

 

原文:https://www.cnblogs.com/bigsister/p/10551445.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!