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

Parse all dates correctly #5

Merged
merged 2 commits into from
Oct 19, 2019
Merged

Conversation

lucbpz
Copy link
Contributor

@lucbpz lucbpz commented Oct 17, 2019

This PR solves #3
Adds some functions for date parsing, following these rules:

If there is no date or year, should return an empty string.
If there is no month, pick 12
If there is no day, pick last day of month

Copy link
Owner

@joshuatz joshuatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! There is just one tiny revision I'd like.

src/main.js Outdated Show resolved Hide resolved
@joshuatz joshuatz merged commit 4bcfbda into joshuatz:master Oct 19, 2019
@joshuatz
Copy link
Owner

@lucbpz Thanks for the contribution! Merged into master, and I'll bump the version number and push a new release to the Chrome web store sometime today.

@mullwaden
Copy link
Contributor

Hi,
I can see why you made this fix, but it can be problematic at times. A profile might, on a work experience for example, have a date range that is "2007 - oct 2007". The above code will interpret that as "2007-12-31 - 2007-10-31".

Start ends up bigger than end. I would suggest the fix is the following:

  • for end dates continue as is done currently ("year-12-31")
  • for start dates chose instead "year-01-01"

Maybe this will break a lot of things for people... Otherwise I am happy to make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants