Renderer not passing through the if condition for a date filed
Renderer not passing through the if condition for a date filed
![Innocentm](https://secure.gravatar.com/avatar/ff3340027f1d5e9f08a55fb7f42a9e49/?default=https%3A%2F%2Fvanillicon.com%2Fff3340027f1d5e9f08a55fb7f42a9e49_200.png&rating=g&size=120)
Am trying to display blank for null or '1971-01-01' fields in my DB but the if block does not get executed
{ data: "eta",
render: function ( data, type, row ) {
if (data =='1971-01-01') {
return '';
}
else {
return data;
}
}
},
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hard to say wihtout seeing your data. Maybe you can add a
console.log
command to see whatdata
actually is:Kevin
Below is my data
I don't see
1971-01-01
in the data you posted above. Maybe you want1970-01-01
instead?Kevin
Thanks Kevin, I have also just spotted that now. It's working!!