From 1dada02926a0eec893478587127986d0ef6ed28c Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Fri, 16 Jun 2023 14:58:33 +0200 Subject: [PATCH] feat: render date in more human format --- templates/datatable.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/templates/datatable.html b/templates/datatable.html index ddf7656..4bc80a5 100644 --- a/templates/datatable.html +++ b/templates/datatable.html @@ -21,6 +21,20 @@ }, "columnDefs": [ { + "targets": 2, + "render": function ( data, type, full, meta ) { + const dateString = data + const dateObj = new Date(dateString); + const options = { day: '2-digit', + month: 'long', + year: 'numeric', + hour: '2-digit', + minute: '2-digit' }; + const formattedDate = dateObj.toLocaleString('de-DE', options); + return formattedDate + } + }, + { "targets": 3, "render": function ( data, type, full, meta ) { return 'Download';