44f7ea61 by yangwei

时间格式化方法

1 parent bddcf056
......@@ -111,14 +111,18 @@ export function down (index, data) {
}
}
export function timeFormat(date) {
export function timeFormat(date,end) {
if (!date || typeof(date) === "string") {
this.error("参数异常,请检查...");
}
var y = date.getFullYear(); //年
var m = date.getMonth() + 1; //月
var d = date.getDate(); //日
return y + "/" + m + "/" + d + ' 00:00:00';
if (end) {
return y + "/" + m + "/" + d + ' 23:59:59';
}else{
return y + "/" + m + "/" + d + ' 00:00:00';
}
}
export function getFirstDayOfSeason (d) {
let date = d || new Date()
......