Skip to content

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

Open
RNabla wants to merge 2 commits into
Miksus:masterfrom
RNabla:b1
Open

Support for datetime.date objects for date-like query fields#7
RNabla wants to merge 2 commits into
Miksus:masterfrom
RNabla:b1

Conversation

@RNabla
Copy link
Copy Markdown

@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