fix: [JS crap] date.getMonth() starts at 0 ¯\_(ツ)_/¯

pull/79/head
Raphaël Vinot 2020-04-29 23:59:42 +02:00
parent 4bd1c4f5fe
commit a42ec8f6b9
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ $(document).ready(function () {
"targets": 1, "targets": 1,
"render": function ( data, type, row, meta ) { "render": function ( data, type, row, meta ) {
let date = new Date(data); let date = new Date(data);
return date.getFullYear() + '-' + date.getMonth().toString().padStart(2, "0") + '-' + date.getDate().toString().padStart(2, "0") + ' ' + date.toTimeString(); return date.getFullYear() + '-' + (date.getMonth() + 1).toString().padStart(2, "0") + '-' + date.getDate().toString().padStart(2, "0") + ' ' + date.toTimeString();
} }
}] }]
} ); } );