Skip to content

Commit

Permalink
index.js: format date
Browse files Browse the repository at this point in the history
Convert to locale date format.

Signed-off-by: Moritz Warning <[email protected]>
  • Loading branch information
mwarning committed Oct 3, 2024
1 parent 479f3dd commit 7926070
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion www/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,14 @@ function createExtra(image) {
);
}

function formatDate(date) {
if (date) {
const d = Date.parse(date);
return new Date(d).toLocaleString();
}
return date;
}

function updateImages(mobj) {
// remove download table
$$("#download-table1 *").forEach((e) => e.remove());
Expand Down Expand Up @@ -576,7 +584,7 @@ function updateImages(mobj) {
setValue("#image-target", mobj.target);
setValue("#image-version", mobj.version_number);
setValue("#image-code", mobj.version_code);
setValue("#image-date", mobj.build_at);
setValue("#image-date", formatDate(mobj.build_at));
setValue("#image-folder", mobj.image_folder);

setValue(
Expand Down

0 comments on commit 7926070

Please sign in to comment.