diff --git a/src/Contact.tsx b/src/Contact.tsx index 8d6d9a4..d1c64cf 100644 --- a/src/Contact.tsx +++ b/src/Contact.tsx @@ -32,18 +32,18 @@ class Contact extends React.Component { function getAllType( propName: string, props: any, - valueToHref?: (value: string) => string, - primaryTransform?: (value: string) => string, - secondaryTransform?: (value: string) => string) { + valueToHref?: (value: string, type: string) => string, + primaryTransform?: (value: string, type: string) => string, + secondaryTransform?: (value: string, type: string) => string) { return contact.comp.getAllProperties(propName).map((prop, idx) => { - const json = prop.toJSON(); + const type = prop.toJSON()[1].type; const values = prop.getValues().map((val) => ( )); @@ -75,6 +75,7 @@ class Contact extends React.Component { }, (x) => x, (x) => (x.substring(x.indexOf(':') + 1)), + (x) => (x.substring(0, x.indexOf(':'))), )); lists.push(getAllType( @@ -91,6 +92,7 @@ class Contact extends React.Component { }, undefined, ((x) => moment(x).format('dddd, LL')), + () => 'Birthday', )); const skips = ['tel', 'email', 'impp', 'adr', 'bday', 'prodid', 'uid', 'fn', 'n', 'version', 'photo'];