Issue #1300 fix: fuzzydate strict date option regex by nandanv2702 · Pull Request #2354 · SheetJS/sheetjs · GitHub
Skip to content

Issue #1300 fix: fuzzydate strict date option regex#2354

Open
nandanv2702 wants to merge 2 commits into
SheetJS:masterfrom
nandanv2702:issue_1300
Open

Issue #1300 fix: fuzzydate strict date option regex#2354
nandanv2702 wants to merge 2 commits into
SheetJS:masterfrom
nandanv2702:issue_1300

Conversation

@nandanv2702

Copy link
Copy Markdown

Hey! This fix refers to issue #1300

I made changes to two of the files to include regex options to parse dates in the following formats:

  • mm dd yyyy
  • mm dd yy
  • dd mm yyyy
  • dd mm yy

All the aforementioned date formats use the separators . or - or /, e.g.:

  • dd-mm-yy
  • dd.mm.yy
  • dd/mm/yy

This can be activated using the strictDate option in the fuzzydate function which is set to false by default.

Let me know whether this solution is what you were looking for!

@SheetJSDev

Copy link
Copy Markdown
Contributor

@nandanv2702

nandanv2702 commented Sep 23, 2021

Copy link
Copy Markdown
Author

Hey! I'll work on the changes for the first point soon, but as for the second - what do you think of including an option similar to dateNF that allows a user to enter the date format as dd-mm-yy, mm-dd-yy etc.?

Alternatively, if strictDates is set to true, we can use dateNF (or the newly defined similar variable as mentioned above) to match any date values to the regex options defined in this PR here

What do you think?

@nandanv2702

Copy link
Copy Markdown
Author

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.

2 participants