client: format dates and times in the "Note Info" widget

This commit is contained in:
Adorian Doran 2024-12-10 18:20:12 +02:00
parent 83e1ce2bc4
commit 19e40bf46b

View File

@ -1,7 +1,9 @@
import { formatDate } from "../../utils/formatters.js"
import { t } from "../../services/i18n.js";
import NoteContextAwareWidget from "../note_context_aware_widget.js";
import server from "../../services/server.js";
import utils from "../../services/utils.js";
import { t } from "../../services/i18n.js";
const TPL = `
<div class="note-info-widget">
@ -121,11 +123,11 @@ export default class NoteInfoWidget extends NoteContextAwareWidget {
this.$noteId.text(note.noteId);
this.$dateCreated
.text(metadata.dateCreated.substr(0, 16))
.text(formatDate(new Date(metadata.dateCreated)))
.attr("title", metadata.dateCreated);
this.$dateModified
.text(metadata.dateModified.substr(0, 16))
.text(formatDate(new Date(metadata.dateModified)))
.attr("title", metadata.dateModified);
this.$type.text(note.type);