Easyui datagrid日期格式化(史上最简单的格式化方法)

{field: 'AddTime', title: '添加时间', width: 100, align: 'center',
                        formatter: function (value) {
                            var dateMat = new Date(parseInt(value.replace("/Date(","").replace(")/",""),10));
                            var year = dateMat.getFullYear();
                            var month = dateMat.getMonth() + 1;
                            var day = dateMat.getDate();
                            return  year + "-" + month + "-" + day;
                        }
}

posted @ 2020-10-15 23:31  河塘月色  阅读(690)  评论(0编辑  收藏  举报