passport-next / passport-facebook

Facebook authentication strategy for Passport and Node.js.
MIT License
10 stars 8 forks source link

Birthday format needs to be consistent #8

Open adamreisnz opened 5 years ago

adamreisnz commented 5 years ago

The birthday field in the profile is populated straight form what comes from Facebook. In this case it's formatted mm/dd/yyyy.

I propose we re-format this to ISO standard format, e.g. YYYY-MM-DD

Can use the following code to achieve this transformation:

if (json.birthday) {
  const parts = json.birthday.split('/');
  profile.birthday = [parts[2], parts[0], parts[1]].join('-');
}
rwky commented 5 years ago

Agreed, YYYY-MM-DD is far less ambiguous than MM-DD-YYYY (which where I come from would be interpreted as DD-MM-YYYY).

adamreisnz commented 5 years ago

Yes same here, great I'll go ahead and implement this, but as it could be a breaking change for some it'll likely need a major version bump. So might want to hold off until it's clear what's happening in terms of unification of the profiles?

rwky commented 5 years ago

Agreed. I'll hopefully get time next week to have a good think on things. I also need to lint all the repos before we go making too many changes.

adamreisnz commented 4 years ago

@rwky do you still maintain this package?

rwky commented 4 years ago

Yep, not worked on unifying profiles lately, promise support has been a higher priority though if you want to add a PR I'll take a look :)

mddmayln commented 1 year ago

I suppose either way Considering same form to understand