export default{
    formatTen(num) {
        return num > 9 ? (num + "") : ("0" + num);
    },
    formatDateTime(date) {
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var day = date.getDate();
        var hour = date.getHours();
        var minute = date.getMinutes();
        return year + '-' + this.formatTen(month) + '-' + this.formatTen(day) + ' '+ this.formatTen(hour) + ':'+ this.formatTen(minute);
    },
    formatDate(date) {
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var day = date.getDate();
        return year + '-' + this.formatTen(month) + '-' + this.formatTen(day)
    }
}

