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
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
I’m depressed. I don’t know why this is happening. There is no problem with the date returned in the background. . .