#3234·dayjs

Day predicates fail with different instance and global numeral locales

Author: xu91102Created Sep 26, 2026Updated Sep 26, 2026

With preParsePostFormat installed, isToday/isTomorrow/isYesterday compare formatted date strings using different numeral locales: the instance's locale on one side and the global locale on the other.

javascript
dayjs.extend(preParsePostFormat);
dayjs.extend(isToday);
dayjs.locale('en');
dayjs().locale('ar').isToday(); // false, expected true

The same mismatch affects tomorrow and yesterday. Arabic postformat emits Arabic digits while the reference date emits Latin digits. Reproduced on dev with Node 22.23.2, macOS. Three tests freeze time, reproduce false negatives and check nonmatching days. Prepared with Codex assistance.