fix(utils): parse relative date with meridiem (#9775)

* fix(utils): parse relative date with meridiem

* fix: use regex
This commit is contained in:
Tony
2022-05-17 01:21:47 -11:00
committed by GitHub
parent 731c11176d
commit 0f31bfa8b9
2 changed files with 8 additions and 2 deletions

View File

@@ -112,6 +112,10 @@ describe('parseRelativeDate', () => {
expect(+new Date(parseRelativeDate('Today 08:00'))).toBe(+date + 8 * hour);
});
it('Today, h:m a', () => {
expect(+new Date(parseRelativeDate('Today, 8:00 pm'))).toBe(+date + 20 * hour);
});
it('TDA H:m:s', () => {
expect(+new Date(parseRelativeDate('TDA 08:00:00'))).toBe(+date + 8 * hour);
});