Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for datetime.date objects for date-like query fields #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RNabla
Copy link

@RNabla RNabla commented Mar 22, 2023

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:

  • string values are stored as before (to have backward compatibility) [2]
  • date objects are being translated to RFC format, e.g. "01-Jan-2022"

[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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant