const moment = require('moment');
class DateClient {
    constructor() {

    }
    betweenDay() {
        return [moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'), moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')]
    }
    betweenMonth() {
        return [moment().startOf('month').format('YYYY-MM-DD HH:mm:ss'), moment().endOf('month').format('YYYY-MM-DD HH:mm:ss')]
    }
    betweenYear() {
        return [moment().startOf('year').format('YYYY-MM-DD HH:mm:ss'), moment().endOf('year').format('YYYY-MM-DD HH:mm:ss')]
    }
    betweenTime(type) {
        let times = [];
        switch (type) {
            case "日":
                times = this.betweenDay();
                break
            case "月":
                times = this.betweenMonth();
                break
            case "年":
                times = this.betweenYear();
                break
            case "全部":
                break
        }
        return times
    }
}
module.exports = DateClient;

