Commit 3f0c9205 by 王昆

gsb

parent 8e6f015e
......@@ -276,5 +276,27 @@ class ServiceBase {
return u;
}
getMonthDays(month) {
let begin = moment().format("YYYY-MM") + "-01 00:00:00";
let end = moment(begin).add(1, "months").subtract(1, 'days').format("YYYY-MM-DD") + " 23:59:59";
return this.getDays(end);
}
getDays(end) {
var days = [];
var month = moment(end).format("YYYY-MM");
var endDay = Number(moment(end).format("DD"));
for (var i = 1; i <= endDay; i++) {
if (i < 10) {
days.push(month + "-0" + i);
} else {
days.push(month + "-" + i);
}
}
return days;
}
}
module.exports = ServiceBase;
\ No newline at end of file
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