How can i add current date at the end of the title? I want to display file name when export it like: excel_22.03.22
$('#example').dataTable({
dom: 'Bfrtip',
buttons: [
{
extend: 'excelHtml5',
title: 'Excel',
text:'Export to excel'
//Columns to export
//exportOptions: {
// columns: [0, 1, 2, 3,4,5,6]
// }
},
{
extend: 'pdfHtml5',
title: 'PDF',
text: 'Export to PDF'
//Columns to export
//exportOptions: {
// columns: [0, 1, 2, 3, 4, 5, 6]
// }
}
]
});
Replace title: 'Excel' with something like this
use dayjs
title : Excel${dayjs().format(YY.MM.DD)}