web: added change date created functionality

Signed-off-by: Muhammad Ali <alihamuh@gmail.com>
This commit is contained in:
alihamuh
2022-12-05 18:07:42 +05:00
parent e7816d0f88
commit f77cbc1517
2 changed files with 10 additions and 1 deletions

View File

@@ -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"

View File

@@ -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);