兼容性问题
2018-11-28 本文已影响0人
Leafmure
iOS设备 日期字符串转日期后显示NaN
iOS系统不支持2017-01-01格式的时间,只识别2017/01/01这样的日期格式
// 日期字符串格式处理
let dateString = dateString.replace(/-/g, '/');
// 日期字符串转日期
let date = new Date(string)
iOS系统不支持2017-01-01格式的时间,只识别2017/01/01这样的日期格式
// 日期字符串格式处理
let dateString = dateString.replace(/-/g, '/');
// 日期字符串转日期
let date = new Date(string)