Intelligent/Adaptive Dates in Search

The Problem

I love the queries to search your inbox, but would be awesome if the date format could be more resillient (intelligent).

Proposed Solution

I would love to have a string evaluation function that supports a lot of date formats, for example:

- "20 aug 2020" => detect as 2020-08-20
- "July 2020" => detect as 2020-07-01 (when in the before query)
- "July 2020" => detect as 2020-07-31 (when in the after query)
- "2020" => detect as 2020-12-31 (when in the after query) 
- "2020" => detect as 2020-01-01 (when in the before query) 
- "2020/08/01" => detect as 2020-08-01 (already working)
- "12.8.2020" => detect as 2020-08-01

These are just suggestions. I think the community should discuss and add all different kinds of date formats that should be supported, then we could define tests and write a function that satisfy all the specified formats.

I would love to help with that. Let me know if this would be something that the community would like to see and I can provide a sample code.


(Originally posted by dcts on GitHub.)