wanasit / chrono

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

Allow querying `chrono-node` for the built-in casual references - eg morning, evening, night #494

Open Nantris opened 1 year ago

Nantris commented 1 year ago

The rationale for this is to make it easier to build refiners - for example I want to make a refiner to imply any reference to "tomorrow" to 12:00pm, but then tomorrow night is set to 12:00pm, even though we're only using imply and not assign

So basically I want to check for "tomorrow night", "tomorrow evening" and so on, and exclude them from the refiner logic - but it would be a lot better to have a complete list provided by the package rather than to write them down myself and hope I got them all (and then ideally check again when the package updates.)

Nantris commented 1 year ago

By the way, is "night" no longer a supported casual reference?

I don't see it mentioned here - but I do see "evening" https://github.com/wanasit/chrono/blob/master/src/common/casualReferences.ts