human friendly date format
This commit is contained in:
parent
3526edb774
commit
8091f87a30
1 changed files with 2 additions and 0 deletions
|
|
@ -34,6 +34,8 @@ const getFileDivHTML = (file_name, size, date, href) => {
|
||||||
if (supported_extensions.includes(extension)) {
|
if (supported_extensions.includes(extension)) {
|
||||||
icon = "ext-" + extension + ".svg";
|
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 `
|
return `
|
||||||
<a class="filerow" href="${href}">
|
<a class="filerow" href="${href}">
|
||||||
<div class="logo-filerow">
|
<div class="logo-filerow">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue