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

Set end datetime ranges to 23:59:59 on the same day #43

Merged
merged 3 commits into from Jan 14, 2020

Conversation

mbonnefoy
Copy link
Contributor

When passing a date to a DateTimeType range filter, we used to set the time to midnight for both the start and the end range filters. So the following search parameters

start__gte='2019-12-25', start__lte='2019-12-25'

would be converted in the sdk to

'start.gte': '2016-12-25T00:00:00.000000', 'start.lte': '2016-12-25T00:00:00.000000'

This would exclude an event with the following start value

'start': '2016-12-25T05:00:00.000000'

This commits sets the end filters (lt, lte) to the datetime max for the day, i.e., 23:59:59.999999. So the parameters mentioned above would now get converted to

'start.gte': '2016-12-25T00:00:00.000000', 'start.lte': '2016-12-25T23:59:59.999999'

and would include the event mentioned above.

When passing a date to a DateTimeType range filter, we used
to set the time to midnight for both the start and the end range
filters. So the following search parameters

`start__gte='2019-12-25', start__lte='2019-12-25'`

would be converted in the sdk to

`'start.gte': '2016-12-25T00:00:00.000000', 'start.lte': '2016-12-25T00:00:00.000000'`

This would exclude an event with the following start value

`'start': '2016-12-25T05:00:00.000000'

This commits sets the end filters (lt, lte) to the datetime max for the day,
i.e., `23:59:59.999999`. So the parameters mentioned above would now get converted to

`'start.gte': '2016-12-25T00:00:00.000000', 'start.lte': '2016-12-25T23:59:59.999999'`

and would include the event mentioned above.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.227% when pulling 3c5f22f on fix-datetime-range into 2c8a153 on master.

@mbonnefoy mbonnefoy merged commit 018f5a1 into master Jan 14, 2020
@mbonnefoy mbonnefoy deleted the fix-datetime-range branch January 14, 2020 23:44
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.

None yet

2 participants