Repository navigation
Conversation
parseImportDate only understood English month names and "Present", so "janvier 2020" failed to parse and fell back to 2000-01-01, and "Présent" or "actuel" were not recognised as ongoing. Build month names for ~20 locales from Intl instead of a hand-written list, and add YYYY-MM, CJK year-month and multilingual ongoing markers. Tell the import prompt not to translate text values and to map "ongoing" in any language to "Present". Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parseImportDateonly understood English month names and the word "Present". For a non-English resume,"janvier 2020" fails to parse and the start date silently becomes 2000-01-01, and "Présent" or
"actuel" is not recognised as ongoing. This makes date parsing locale-independent.
Changes
src/actions/resumeImport/dates.ts: month names for about 20 locales are built fromIntl(longand short forms, accents folded) rather than hand-written lists. Names that mean different months in
different locales are dropped as ambiguous.
YYYY-MM,YYYY/MM, CJK year-month (2020年3月) and filler words (enero de 2020).parseImportDateinshared.tsuses the new helpers; existing formats (Jan 2020,2020,MM/YYYY) behave as before.in any language to "Present".
__tests__/resumeImportDates.spec.ts(27 cases).Related Issues
Testing
npm run lintandtsc --noEmitare clean.devin my environment (jsdom/
localStoragesetup), unrelated to this change.image's Node 20.
Notes
Independent of the language-output PR; either can merge first.