From 535a2e09ecfed21ed798ad3c81c0e1408ea283cf Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Thu, 14 Aug 2025 15:02:33 +0200 Subject: [PATCH 1/2] fix: enforce correct icaltype when constructing VCardTime Signed-off-by: Richard Steinmetz --- src/components/Properties/PropertyDateTime.vue | 2 +- src/store/contacts.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Properties/PropertyDateTime.vue b/src/components/Properties/PropertyDateTime.vue index 83879cf353..69419d8eb8 100644 --- a/src/components/Properties/PropertyDateTime.vue +++ b/src/components/Properties/PropertyDateTime.vue @@ -134,7 +134,7 @@ export default { vcardTimeLocalValue() { if (typeof this.localValue === 'string') { // eslint-disable-next-line new-cap - return new ICAL.VCardTime.fromDateAndOrTimeString(this.localValue) + return new ICAL.VCardTime.fromDateAndOrTimeString(this.localValue, this.propType) } return this.localValue }, diff --git a/src/store/contacts.js b/src/store/contacts.js index 945793f079..57bae03cc6 100644 --- a/src/store/contacts.js +++ b/src/store/contacts.js @@ -331,7 +331,7 @@ const actions = { validate(contact) // Update REV - contact.rev = ICAL.VCardTime.now().convertToZone(ICAL.Timezone.utcTimezone) + contact.rev = ICAL.VCardTime.fromDateAndOrTimeString(new Date().toISOString(), 'date-time') const vData = contact.toStringStripQuotes() From 724401494188bc211aaaae0c0ccc9d1f85d3b889 Mon Sep 17 00:00:00 2001 From: SebastianKrupinski Date: Thu, 14 Aug 2025 09:25:09 -0400 Subject: [PATCH 2/2] fixup! fix: enforce correct icaltype when constructing VCardTime Signed-off-by: SebastianKrupinski --- src/models/contact.js | 2 +- src/services/checks/invalidREV.js | 2 +- src/views/Contacts.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/contact.js b/src/models/contact.js index f2e0846829..a574096f75 100644 --- a/src/models/contact.js +++ b/src/models/contact.js @@ -66,7 +66,7 @@ export default class Contact { // if no rev set, init one if (!this.vCard.hasProperty('rev')) { - this.vCard.addPropertyWithValue('rev', ICAL.VCardTime.now().convertToZone(ICAL.Timezone.utcTimezone)) + this.vCard.addPropertyWithValue('rev', ICAL.VCardTime.fromDateAndOrTimeString(new Date().toISOString(), 'date-time')) } } diff --git a/src/services/checks/invalidREV.js b/src/services/checks/invalidREV.js index 6a75c227b7..17bcd92d81 100644 --- a/src/services/checks/invalidREV.js +++ b/src/services/checks/invalidREV.js @@ -41,7 +41,7 @@ export default { contact.vCard.removeProperty('rev') // creatiing new value - contact.vCard.addPropertyWithValue('rev', ICAL.VCardTime.now().convertToZone(ICAL.Timezone.utcTimezone)) + contact.vCard.addPropertyWithValue('rev', ICAL.VCardTime.fromDateAndOrTimeString(new Date().toISOString(), 'date-time')) return true } catch (error) { diff --git a/src/views/Contacts.vue b/src/views/Contacts.vue index 9f9f74656b..2c3e5fa7c9 100644 --- a/src/views/Contacts.vue +++ b/src/views/Contacts.vue @@ -292,7 +292,7 @@ export default { contact.fullName = t('contacts', 'Name') - contact.rev = ICAL.VCardTime.now().convertToZone(ICAL.Timezone.utcTimezone) + contact.rev = ICAL.VCardTime.fromDateAndOrTimeString(new Date().toISOString(), 'date-time') // itterate over all properties (filter is not usable on objects and we need the key of the property) const properties = rfcProps.properties