I'm using datatable's date filter, but I can't change the language of the date.
I tried as below but it doesn't work. still in english.
minDate = new DateTime($('#min'), {
format: 'MMMM Do YYYY',
locale: 'tr-TR',
language: 'tr-TR,
lang: 'tr-TR
});
https://datatables.net/extensions/datetime/examples/integration/datatables.html
var minDate, maxDate;
// Custom filtering function which will search data in column four between two values
$.fn.dataTable.ext.search.push(
function( settings, data, dataIndex ) {
var min = minDate.val();
var max = maxDate.val();
var date = new Date( data[4] );
if (
( min === null && max === null ) ||
( min === null && date <= max ) ||
( min <= date && max === null ) ||
( min <= date && date <= max )
) {
return true;
}
return false;
}
);
$(document).ready(function() {
// Create date inputs
minDate = new DateTime($('#min'), {
format: 'MMMM Do YYYY'
});
maxDate = new DateTime($('#max'), {
format: 'MMMM Do YYYY'
});
// DataTables initialisation
var table = $('#example').DataTable();
// Refilter the table
$('#min, #max').on('change', function () {
table.draw();
});
});


