当前位置 : 主页 > 网页制作 > Dojo >

dojo js 字符串日期转换成年-月-日

来源:互联网 收集:自由互联 发布时间:2021-06-15
var dataArray = []; var regExp = new RegExp(/(\d{4})(\d{2})(\d{2})/); var weekTime = dojo.map(data,function(item,index){regExp.test(item.exchange_date);return RegExp.$1 + "-" + RegExp.$2 + "-" + RegExp.$3;}); console.log(weekTime); dojo实现
            var dataArray = [];
    var regExp = new RegExp(/(\d{4})(\d{2})(\d{2})/);
	    var weekTime = dojo.map(data,function(item,index){
			regExp.test(item.exchange_date);
			return RegExp.$1 + "-" +  RegExp.$2 + "-" + RegExp.$3;
		});
	    console.log(weekTime);
dojo实现例如将20130222转换成2013-02-22
网友评论