From 8e31b0459582094a82b422f01e4d2a4c54ab37ca Mon Sep 17 00:00:00 2001 From: jokoprasetio Date: Sun, 27 Apr 2025 23:46:03 +0700 Subject: [PATCH] done --- public/js/transaksi/dt.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/public/js/transaksi/dt.js b/public/js/transaksi/dt.js index a89bcea..1f4c326 100644 --- a/public/js/transaksi/dt.js +++ b/public/js/transaksi/dt.js @@ -90,5 +90,24 @@ dataTable.bootstrapTable({ sortable: true, }, + { + title: "Waktu Tindakan", + field: "created_at", + sortable: true, + formatter: function(value, row, index) { + console.log(row); + + if (!value) return '-'; + + const date = new Date(value); + const options = { year: 'numeric', month: 'short', day: 'numeric' }; + const formattedDate = date.toLocaleDateString('id-ID', options); + + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + + return `${formattedDate} ${hours}:${minutes}`; + } + }, ], });