penge / my-notes

Simple and fast note-taking in Chrome with Google Drive support.
https://chrome.google.com/webstore/detail/my-notes/lkeeogfaiembcblonahillacpaabmiop
MIT License
242 stars 34 forks source link

Fix time and dateTime parsing #390

Closed penge closed 2 years ago

penge commented 2 years ago

Because relying on toLocaleString to parse date, time, or date+time to locale language, turned out there was an update and en-US locale uses now " at " as date+time separator compared to previous ", ". This caused problem to parse the time portion. As any locale can have different date+time separator or the separator can change as it happened now, the current solution wasn't reliable. Instead, I am updating this parsing so it does NOT rely on any date+time separator, which solved the problem.