From 059522532ad980212f5b5593d4329c112f7d9b2f Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 6 Aug 2020 09:24:26 +0300 Subject: [PATCH] Fix setting of mtime for newly created items. --- src/Calendars/Main.tsx | 4 ++-- src/Collections/ImportDialog.tsx | 2 +- src/Contacts/Main.tsx | 4 ++-- src/Tasks/Main.tsx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Calendars/Main.tsx b/src/Calendars/Main.tsx index 859ddc8..320da45 100644 --- a/src/Calendars/Main.tsx +++ b/src/Calendars/Main.tsx @@ -65,7 +65,7 @@ export default function CalendarsMain() { const collection = collections!.find((x) => x.uid === collectionUid)!; const itemMgr = colMgr.getItemManager(collection); - const mtime = (new Date()).getUTCMilliseconds(); + const mtime = (new Date()).getTime(); const content = item.toIcal(); let eteItem; @@ -95,7 +95,7 @@ export default function CalendarsMain() { const itemMgr = colMgr.getItemManager(collection); const eteItem = items!.get(collectionUid)?.get(itemUid)!; - const mtime = (new Date()).getUTCMilliseconds(); + const mtime = (new Date()).getTime(); const meta = await eteItem.getMeta(); meta.mtime = mtime; await eteItem.setMeta(meta); diff --git a/src/Collections/ImportDialog.tsx b/src/Collections/ImportDialog.tsx index 7b45f43..796d576 100644 --- a/src/Collections/ImportDialog.tsx +++ b/src/Collections/ImportDialog.tsx @@ -61,7 +61,7 @@ export default function ImportDialog(props: PropsType) { const eteItems = []; for (const item of items) { - const mtime = (new Date()).getUTCMilliseconds(); + const mtime = (new Date()).getTime(); const meta = { mtime, name: item.uid, diff --git a/src/Contacts/Main.tsx b/src/Contacts/Main.tsx index 23b2616..9addfa9 100644 --- a/src/Contacts/Main.tsx +++ b/src/Contacts/Main.tsx @@ -61,7 +61,7 @@ export default function ContactsMain() { const collection = collections!.find((x) => x.uid === collectionUid)!; const itemMgr = colMgr.getItemManager(collection); - const mtime = (new Date()).getUTCMilliseconds(); + const mtime = (new Date()).getTime(); const content = item.toIcal(); let eteItem; @@ -91,7 +91,7 @@ export default function ContactsMain() { const itemMgr = colMgr.getItemManager(collection); const eteItem = items!.get(collectionUid)?.get(itemUid)!; - const mtime = (new Date()).getUTCMilliseconds(); + const mtime = (new Date()).getTime(); const meta = await eteItem.getMeta(); meta.mtime = mtime; await eteItem.setMeta(meta); diff --git a/src/Tasks/Main.tsx b/src/Tasks/Main.tsx index 5df1dc3..5eee8c2 100644 --- a/src/Tasks/Main.tsx +++ b/src/Tasks/Main.tsx @@ -61,7 +61,7 @@ export default function TasksMain() { const collection = collections!.find((x) => x.uid === collectionUid)!; const itemMgr = colMgr.getItemManager(collection); - const mtime = (new Date()).getUTCMilliseconds(); + const mtime = (new Date()).getTime(); const content = item.toIcal(); let eteItem; @@ -91,7 +91,7 @@ export default function TasksMain() { const itemMgr = colMgr.getItemManager(collection); const eteItem = items!.get(collectionUid)?.get(itemUid)!; - const mtime = (new Date()).getUTCMilliseconds(); + const mtime = (new Date()).getTime(); const meta = await eteItem.getMeta(); meta.mtime = mtime; await eteItem.setMeta(meta);