1
0

fix: don't try to parse date numbers with letters around them

This commit is contained in:
kolaente
2022-01-30 12:37:14 +01:00
parent b3697cb9bf
commit 931941359b
2 changed files with 8 additions and 2 deletions

View File

@ -288,7 +288,7 @@ const getDateFromWeekday = (text: string): dateFoundResult => {
}
const getDayFromText = (text: string) => {
const matcher = /(([1-2][0-9])|(3[01])|(0?[1-9]))(st|nd|rd|th|\.)/ig
const matcher = /($| )(([1-2][0-9])|(3[01])|(0?[1-9]))(st|nd|rd|th|\.)($| )/ig
const results = matcher.exec(text)
if (results === null) {
return {