Support for datetime.date objects for date-like query fields #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
Currently date-like query fields are accepting strings. This PR adds support for using datetime.date/datetime objects.
Current string values were just stored without any format check, e.g. tests are using value of '2022-01-01', which does not conform to RFC [1]. To summarize:
[1] When I try to use "yyyy-mm-dd" format, gmail raises "Could not parse command" error, not sure if other email providers support such constructs, but I believe it's safer to use RFC format
[2] I couldn't find any examples in documentation that are using this invalid date format, but I've also updated tests to use RFC conforming format -> hopefully this will improve interoperability - by someone not blindly copying examples that may not be supported by email providers