self.FormatJsonDate = function (jsonStr) {
var tmp = "";
if (jsonStr == null || jsonStr == '')
return '';
if (jsonStr != null || jsonStr != undefined)
tmp = jsonStr.toString();
var seconds = tmp.replace(/\/Date\(/, "").replace(/\)\//, "");
var now = new Date(parseInt(seconds));
return now.asString("yyyy-mm-dd hh:ii:ss");
};
//从JSON格式的日期格式化为yyyy-mm-dd
self.FormatYMD = function (jsonStr) {
var tmp = self.FormatJsonDate(jsonStr);
tmp = tmp.substr(0, 10);
return tmp;
};
//从JSON格式的日期格式化为yyyy-mm-dd hh:mm:ss
self.FromatYMDHI = function (jsonStr) {
var tmp = self.FormatJsonDate(jsonStr);
tmp = tmp.substr(0, 19);
return tmp;
};
//从JSON格式的日期格式化为yyyy-mm-dd hh:mi
self.FromatYMDHM = function (jsonStr) {
var tmp = self.FormatJsonDate(jsonStr);
tmp = tmp.substr(0, 16);
return tmp;
};