Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Birthdays are Imported incorrectly #32

Closed
jacobamiller opened this issue Oct 22, 2020 · 7 comments
Closed

Birthdays are Imported incorrectly #32

jacobamiller opened this issue Oct 22, 2020 · 7 comments
Assignees
Labels
bug Something isn't working vCard Issues affecting the vCard functionality of the extension

Comments

@jacobamiller
Copy link

Recently all birthdays are 1 month off from what is said on LinkedIn for example a Jan 15th is being changed to Feb 15th

@joshuatz joshuatz self-assigned this Oct 23, 2020
@joshuatz joshuatz added bug Something isn't working vCard Issues affecting the vCard functionality of the extension labels Oct 23, 2020
@joshuatz
Copy link
Owner

Thanks for reporting. I can confirm I see the same problem with generated vCards, although I don't think this is a regression, but just something I missed from the beginning.

Seems odd, since I thought both LI and JS's Date() constructor use a zero-based index for months, so they should align... regardless, I'll look into it shortly.

@joshuatz
Copy link
Owner

I had this wrong; LI specifically does not use zero-based indexing for months, but the JS Date constructor does (or at least does when calling it with numerical arguments), which is precisely why this bug exists. Fixed by making sure date object that gets constructed (and passed to vCard creator) does not have offset month.

@jacobamiller Thanks for reporting. Fix has been released and pushed to webstore (pending Google's review) - v1.5.0.

@jacobamiller
Copy link
Author

I just updated to 1.5.0 and tried importing 3 different contacts with Birthday however No Birthday is imported to the VCard, when I opened the Vcard in a text editor I see "BDAY:NaNaNaN"

@joshuatz
Copy link
Owner

Blergh. You are right; it seems to be working with certain profiles but not others (I only could find one profile with a birthday when I was originally working on this, but just found another now that has your issue). I'll look into it.

@joshuatz joshuatz reopened this Oct 24, 2020
@joshuatz
Copy link
Owner

joshuatz commented Oct 24, 2020

Found the issue; it happens with profiles that specify a birthday without giving a birth year (i.e., so no one can know their age). The vCard spec allows for partial (aka truncated) BDAY entries.

However, this might take me some time to fix, because the vCard generator library I'm using (this one, which is a fork of this one) does not correctly implement this (it requires full JS dates), nor do many of the popular libraries or their forks. I might need to create my own fork and PR to their repo, or search around for a library that correctly implements the vCard BDAY specification.

EDIT: This is not the full truth, see subsequent comment

@joshuatz
Copy link
Owner

joshuatz commented Nov 8, 2020

The issue was indeed due to partial BDAY entries, but I was only half-right in asserting that the vCard spec supports these; that is only true in v4 and up, and this tool currently uses a library that only supports v3. Furthermore, v3 seems to be supported by a far wider array of platforms and tools, so switching this extension over to v4 is probably not the best move.

The easiest fix, which I've just applied and released in v1.5.1, is to omit the birthday as part of the vCard export if the LinkedIn user did not include their birthyear in their profile.


Notes to self (or anyone else curious)

@jacobamiller
Copy link
Author

I would suggest that if a partial Birthday to set the Year to 1900, I would prefer to have contacts Bdays with a clearly wrong Year vs no Birthday at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vCard Issues affecting the vCard functionality of the extension
Projects
None yet
Development

No branches or pull requests

2 participants