From c51804d7fec25f0d83a1cc7776f922f317808781 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 13 Dec 2017 15:22:00 +0000 Subject: [PATCH] Event and contact: update last modified. --- src/ContactEdit.tsx | 1 + src/EventEdit.tsx | 2 ++ src/ical.js.d.ts | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/ContactEdit.tsx b/src/ContactEdit.tsx index 11a79ed..5f04f03 100644 --- a/src/ContactEdit.tsx +++ b/src/ContactEdit.tsx @@ -259,6 +259,7 @@ class ContactEdit extends React.Component { comp.updatePropertyWithValue('version', '4.0'); comp.updatePropertyWithValue('uid', this.state.uid); comp.updatePropertyWithValue('fn', this.state.fn); + comp.updatePropertyWithValue('rev', ICAL.Time.now()); function setProperties(name: string, source: ValueType[]) { comp.removeAllProperties(name); diff --git a/src/EventEdit.tsx b/src/EventEdit.tsx index 1921923..4bd8ec9 100644 --- a/src/EventEdit.tsx +++ b/src/EventEdit.tsx @@ -135,6 +135,8 @@ class EventEdit extends React.Component { event.location = this.state.location; event.description = this.state.description; + event.component.updatePropertyWithValue('last-modified', ICAL.Time.now()); + this.props.onSave(event, this.state.journalUid, this.props.event); } diff --git a/src/ical.js.d.ts b/src/ical.js.d.ts index 1d30e97..4695542 100644 --- a/src/ical.js.d.ts +++ b/src/ical.js.d.ts @@ -60,6 +60,8 @@ declare module 'ical.js' { static fromString(str: string): Time; + static now(): Time; + constructor(data?: { year?: number, month?: number,