Skip to content

Commit

Permalink
Update jct.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeANi-SHILIX committed Aug 26, 2023
1 parent ccb1453 commit caf0fcb
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions helpers/jct.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ async function getMails() {
mailName: mail.c[0]?.v.split(":")[0]?.trim() || "",
nickname: mail.c[1]?.v || "",
phone: mail.c[2]?.v || "",
name: mail.c[3]?.v || "",
officeReceptionHours: mail.c[4]?.v || "",
phoneReceptionHours: mail.c[5]?.v || "",
location: mail.c[6]?.v || "",
whatsapp: mail.c[7]?.v || "",
whatsapp: mail.c[3]?.v || "",
name: mail.c[4]?.v || "",
officeReceptionHours: mail.c[5]?.v || "",
phoneReceptionHours: mail.c[6]?.v || "",
location: mail.c[7]?.v || "",
}
contacts.push(contact);
}
Expand Down Expand Up @@ -153,7 +153,18 @@ function makeVcard(contact = {}) {

if (contact.mail) VCARD += `EMAIL:${contact.mail}\n`

if (contact.location) VCARD += `ADR;type=WORK:;;${contact.location};\n`
if (contact.location) {
let address = contact.location.split(",").map(p => p.trim());
VCARD += `ADR;type=WORK:;;${address[0]}${address[1] ? ";" + address[1] : ""}${address[2] ? ";" + address[2] : ""};\n`
}

if (contact.officeReceptionHours)
// "Reception" property is not exist, show as "other"
VCARD += `Reception:שעות קבלה במשרד: ${contact.officeReceptionHours}\n`

if (contact.phoneReceptionHours)
// "Reception" property is not exist, show as "other"
VCARD += `Reception:שעות קבלה בטלפון: ${contact.phoneReceptionHours}\n`

VCARD += `END:VCARD`

Expand Down

0 comments on commit caf0fcb

Please sign in to comment.