Display the word "Today" instead of data format in Datatable.js table

Viewed 79

I would like to display the word "Today" instead of, for example, "Mon 16 Aug 2021" in my Datatable.js table.

See fiddle here: https://jsfiddle.net/mauricetwomey/nsbk7Lry/62/

I would like the result to display "Today" wherever today's date is in the table:

datatable

I am using moment.js to handle the date formatting but I cannot get the locale feature to automatically change a date format to a string.

$(document).ready( function () {
    $.fn.dataTable.moment('ddd D MMM YYYY');
    var table = $("#orders").DataTable({
        columns: [
            { orderable: !1 },
            { orderable: !0 },
            { orderable: !1 },
            { orderable: !1 },
            { orderable: !1 },
        ],
        order: [[1, "desc"]],
    });
});
1 Answers
Related