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

Date.create to find a date in complex string #676

Open
MeloJR opened this issue Jun 25, 2021 · 0 comments
Open

Date.create to find a date in complex string #676

MeloJR opened this issue Jun 25, 2021 · 0 comments

Comments

@MeloJR
Copy link

MeloJR commented Jun 25, 2021

Hi! I have tried the Date.create function with severals date patterns and it works perfectly but I found that it only works if the string only includes the date. If the string has other parts before/after the date, it fails. I think the problem is the way the format RegEx are built:

Sugar/lib/date.js

Line 2297 in 3ca5781

reg: RegExp('^ *' + format + ' *$', 'i'),

I want to be able to parse a date from the string "New York, 22 August" the same way as from the string "22 August". Is there a way to solve my problem with Sugar?

Thank you in advance.

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

No branches or pull requests

1 participant