javascript - The Date variable returned in the background is null, but the value taken out using moment.js is Invalid date
三叔
三叔 2017-07-05 10:42:27
0
1
1015

As the title states, the time I retrieved in the background is null, but the time displayed using moment.js is Invalid date

The front-end code for using datatable is:

{
    data: 'v.testTime',
    orderable: false,
    render: function (data, type, full) {
    return moment(full.testTime).format("YYYY-MM-DD HH:MM:SS");
    }
},

When testTime is null, the front end displays Invalid date. What is the problem? How can it be displayed as empty? Thank you.

Note: Use google chrome 59.0.3071.115 browser

三叔
三叔

reply all(1)
迷茫

I tried using isValid and found that the entered dates were all invalid, but it works if I don’t use moment.js. The code is changed to this

{
    data: 'v.testTime',
    orderable: false,
    render: function (data, type, full) {
    return full.testTime;
    }
},

I’m depressed. I don’t know why this is happening. There is no problem with the date returned in the background. . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template