//将yyyymmdd转换成yyyy-mm-dd
将"20210415"转换成2021-04-15
var time= datas[0].交货日期;//20210415转成字符串
var dateString = time+’’;
var pattern = /(\d{4})(\d{2})(\d{2})/;
var formatedDate = dateString.replace(pattern, ‘$1-$2-$3’);
//将yyyymmdd转换成yyyy-mm-dd
将"20210415"转换成2021-04-15
var time= datas[0].交货日期;//20210415转成字符串
var dateString = time+’’;
var pattern = /(\d{4})(\d{2})(\d{2})/;
var formatedDate = dateString.replace(pattern, ‘$1-$2-$3’);