wanasit / chrono

A natural language date parser in Javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Current version (2.6.0) doesn't work with Safari

schvenk opened this issue · comments

Something regex-related in the current version isn't working with Safari v16.3. I get the following error in the JS console simply by importing parseDate() in a freshly-created React app:

SyntaxError: Invalid regular expression: invalid group specifier name

The line it's complaining about:

const PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night|(?<!\d\s*)day\s*after\s*tomorrow|(?<!\d\s*)day\s*before\s*yesterday)(?=\W|$)/i;

Thanks!

Hello. Sorry for the problem. Could you please try the new version?
https://github.com/wanasit/chrono/releases/tag/v2.6.1

That works! Thank you!!