Commit 2d99544a authored by 于广洋's avatar 于广洋

第一次进入后边如果有错误的 话,切换月份好用

parent 4e983808
...@@ -290,7 +290,7 @@ function initPage(companyInfo) { ...@@ -290,7 +290,7 @@ function initPage(companyInfo) {
//TODO 调用备案接口 //TODO 调用备案接口
}); });
// 格式化后台返回的时间 // 格式化后台返回的时间
if(companyInfo){ if(companyInfo.config.return){
$("#getInputValue").val(tool.formatDate(companyInfo.sbsq)); $("#getInputValue").val(tool.formatDate(companyInfo.sbsq));
nowdate = companyInfo.sbsq; nowdate = companyInfo.sbsq;
drawGrid(companyInfo); drawGrid(companyInfo);
......
...@@ -824,7 +824,12 @@ var JSTOOL = function() { ...@@ -824,7 +824,12 @@ var JSTOOL = function() {
* 将000000格式化为0000-00-00 * 将000000格式化为0000-00-00
*/ */
this.formatDate = function(date) { this.formatDate = function(date) {
if(date){
return date.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3"); return date.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3");
}else{
return ""
}
} }
//字符串时间转时间戳用比较大小 //字符串时间转时间戳用比较大小
this.bijiaodata = function(data, data1) { this.bijiaodata = function(data, data1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment