chore: test parseRelativeDate in cloudflare

This commit is contained in:
Ou 2024-10-23 04:05:33 +08:00
parent 1011aa0581
commit 164735ef18

View File

@ -212,6 +212,8 @@ export function parseRelativeDate(date: string, timezone: string = "UTC") {
for (const w of words) {
const wordMatches = w.regExp.exec(theDate)
if (wordMatches) {
console.log(offset)
console.log(w.startAt.format("YYYY-MM-DD"))
console.log(`${w.startAt.add(offset).format("YYYY-MM-DD")}`)
// The default parser of dayjs() can parse '8:00 pm' but not '8:00pm'
// so we need to insert a space in between