human friendly date format

This commit is contained in:
John Hess 2024-06-07 18:32:47 -05:00
parent 3526edb774
commit 8091f87a30

View file

@ -34,6 +34,8 @@ const getFileDivHTML = (file_name, size, date, href) => {
if (supported_extensions.includes(extension)) {
icon = "ext-" + extension + ".svg";
}
// turn date from "2021-09-01 12:34:56" to "Sep 1, 2021"
date = new Date(date).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
return `
<a class="filerow" href="${href}">
<div class="logo-filerow">