dateFormat.js 1 KB
/**
 * 时间处理插件
 */
class dealDate {
    constructor() {
        this.instance = null;
    }

    static getInstance() {
        if (!this.instance) {
            this.instance = new dealDate()
        }
        return this.instance;
    }

    /**
     * 格式化 yyyy-MM-dd
     */
    dateFormatter(date) {
        if (!date instanceof Object) {
            date = new Date(Date.parse(date));
        }
        //
    }

    /**
     * 日期字符串转化日期对象
     */
    isDateObject(date) {
        let dateObj = {};
        dateObj = !date instanceof Object ? new Date(Date.parse(date)) : date;
        return dateObj
    }

    /**
     * day
     */
    getDayDt(date) {
        if (!date instanceof Object) {
            date = new Date(Date.parse(date));
        }
    }

    /**
     * week
     */
    getWeekDt(date) {}

    /**
     * month
     */
    getMonthDt(date) {}

    /**
     * year
     */
    getYearDt(date) {}
}

const dealDate = dealDate.getInstance();
export {
    dealDate
}