ABP中table时间格式化

 {
                targets: 6,
                data: 'graduationTime',
                sortable: false,
                render: function (graduationTime) {
                    return moment(graduationTime).format('L');
                }
            },


  {
                targets: 8,
                data: 'birthday',
                sortable: false,
                render: function (birthday) {
                    return moment(birthday).format('YYYY-MM-DD');
                }
            }

moment.js

    var defaultCalendar = {
        sameDay : '[Today at] LT',
        nextDay : '[Tomorrow at] LT',
        nextWeek : 'dddd [at] LT',
        lastDay : '[Yesterday at] LT',
        lastWeek : '[Last] dddd [at] LT',
        sameElse : 'L'
    };

    function calendar (key, mom, now) {
        var output = this._calendar[key] || this._calendar['sameElse'];
        return isFunction(output) ? output.call(mom, now) : output;
    }

    var defaultLongDateFormat = {
        LTS  : 'h:mm:ss A',
        LT   : 'h:mm A',
        L    : 'MM/DD/YYYY',
        LL   : 'MMMM D, YYYY',
        LLL  : 'MMMM D, YYYY h:mm A',
        LLLL : 'dddd, MMMM D, YYYY h:mm A'
    };

猜你喜欢

转载自www.cnblogs.com/wangyinlon/p/13177515.html
今日推荐