使用 Logseq 编写模板的时候,发现获取日期的逻辑难以理解,我在 Mac 的系统设置中设定每周从周日开始,今天是 2023-09-11 ,那么本周应该是从 2023-09-10 到 2023-09-16 ,但查出来的日期感觉非常奇怪,有没有前端大佬可以解释一下原因
❯ node
Welcome to Node.js v18.17.1.
Type ".help" for more information.
> const chrono = require('chrono-node');
undefined
> chrono.parseDate('friday')
2023-09-08T04:00:00.000Z
> chrono.parseDate('this friday')
2023-09-15T04:00:00.000Z
> chrono.parseDate('thursday')
2023-09-14T04:00:00.000Z
> chrono.parseDate('sunday')
2023-09-10T04:00:00.000Z
> chrono.parseDate('this sunday')
2023-09-17T04:00:00.000Z
> chrono.parseDate('today')
2023-09-11T09:14:35.989Z
>