Authored by chenchao

修复日期格式

... ... @@ -3,6 +3,7 @@ var $ = require('jquery'),
common = require('../../../common/common'),
rejectPromotions=require('./partials/edit_reject');
var baseInfoEdit=require('./partials/edit_baseinfo');
var date_util=require('./partials/_date_util');
/*
* 获取业务数据
*/
... ... @@ -39,6 +40,16 @@ var ENUM = {
{en:"reject",cn:"互斥促销"},
{en:"display",cn:"促销显示"},]
};
var fixDateTime=function(){
if(PromotionInfo.startTime&&PromotionInfo.startTime>0){
PromotionInfo.startTime=date_util.getDateStr(PromotionInfo.startTime);
}
if(PromotionInfo.endTime&&PromotionInfo.endTime>0){
PromotionInfo.endTime=date_util.getDateStr(PromotionInfo.endTime);
}
}
//修复日期格式,只修改一次即可
fixDateTime();
//加载显示tab页内容
var loadTabHtml=function(columnname){
var default_html="<a href='#'>bad error</a>";
... ...
var _date_util={
getDateStr:function(datetime) {
var date = new Date(datetime * 1000);
return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
}
}
module.exports = _date_util;
\ No newline at end of file
... ...