Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/models/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ 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))
const rev = new ICAL.VCardTime(null, null, 'date-time')
rev.fromUnixTime(Date.now() / 1000)
this.vCard.addPropertyWithValue('rev', rev)
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/services/checks/invalidREV.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export default {
contact.vCard.removeProperty('rev')

// creatiing new value
contact.vCard.addPropertyWithValue('rev', ICAL.VCardTime.now().convertToZone(ICAL.Timezone.utcTimezone))
const rev = new ICAL.VCardTime(null, null, 'date-time')
rev.fromUnixTime(Date.now() / 1000)
contact.vCard.addPropertyWithValue('rev', rev)

return true
} catch (error) {
Expand Down
4 changes: 3 additions & 1 deletion src/store/contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ const actions = {
validate(contact)

// Update REV
contact.rev = ICAL.VCardTime.now().convertToZone(ICAL.Timezone.utcTimezone)
const rev = new ICAL.VCardTime()
rev.fromUnixTime(Date.now() / 1000)
contact.rev = rev

const vData = contact.toStringStripQuotes()

Expand Down
6 changes: 3 additions & 3 deletions src/views/Contacts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export default {
emit('contacts:circles:append', this.selectedCircle.id)
return
}

const rev = new ICAL.VCardTime()
const contact = new Contact(`
BEGIN:VCARD
VERSION:4.0
Expand All @@ -291,8 +291,8 @@ export default {
this.defaultAddressbook)

contact.fullName = t('contacts', 'Name')

contact.rev = ICAL.VCardTime.now().convertToZone(ICAL.Timezone.utcTimezone)
rev.fromUnixTime(Date.now() / 1000)
contact.rev = rev

// itterate over all properties (filter is not usable on objects and we need the key of the property)
const properties = rfcProps.properties
Expand Down