diff --git a/apps/web/src/components/properties/index.js b/apps/web/src/components/properties/index.js index 8fe1c7713..5343819e4 100644 --- a/apps/web/src/components/properties/index.js +++ b/apps/web/src/components/properties/index.js @@ -200,7 +200,10 @@ function Properties(props) { showMonthDropdown showYearDropdown selected={startDate || item.value(session[item.key])} - onChange={(date) => setStartDate(date)} + onChange={async (date) => { + setStartDate(date); + await noteStore.dateCreated(sessionId, date); + }} dropdownMode="select" timeInputLabel="Time:" dateFormat="MMM d, yyyy, h:mm aa" diff --git a/apps/web/src/stores/note-store.js b/apps/web/src/stores/note-store.js index 937818b0e..3ba536438 100644 --- a/apps/web/src/stores/note-store.js +++ b/apps/web/src/stores/note-store.js @@ -129,6 +129,12 @@ class NoteStore extends BaseStore { }); }; + dateCreated = async (id, dateCreated) => { + await db.notes.add({ id, dateCreated }); + this._syncEditor(id, "dateCreated", dateCreated); + this.refresh(); + }; + lock = async (id) => { await Vault.lockNote(id); this.refreshItem(id);