wanasit / chrono

A natural language date parser in Javascript
MIT License
4.6k stars 341 forks source link

Parse "last/next business day (weekday)", "weekend" #572

Closed joshp12345 closed 1 month ago

joshp12345 commented 1 month ago

https://github.com/wanasit/chrono/issues/294

https://github.com/obsidian-tasks-group/obsidian-tasks/issues/3122

https://dictionary.cambridge.org/dictionary/english/weekday

I'd like to request support for parsing "weekdays", but by weekdays I mean days that are Monday through Friday and excluding the weekend days Saturday & Sunday. I believe the previous issue #294 was closed in error due to a misunderstanding as weekday and day have different meanings in the context of a tool like this.

With this implemented, "last weekday" would function as "yesterday" except on Sunday & Monday, where "last weekday" would produce the previous Friday. The other use cases would be similar.

wanasit commented 1 month ago

Thanks for reporting. I added "weekday" and "weekend" support in 3a15d3dc5c2aced5b7fc5252a6576f6622de7953.

joshp12345 commented 1 month ago

Amazing, thank you!!