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

Assume end of day on daterange filter when no time was passed #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

curtisy1
Copy link
Contributor

Filtering a date range with start and end being the same date (without time) will result in no results being found since the dates are identical (e.g. 2020-03-26~2020-03-26).

This PR takes the end of day for the end date if only the date was passed to allow for same-day filtering.

Potentially this is a breaking change if users now rely on no results being returned

@mcintyre321
Copy link
Owner

mcintyre321 commented Mar 31, 2020

It sounds like you may be using a Date filter when you should be using a DateTime filter. Or maybe you have data with time values, but want date only data?

if you add a [DataTablesFilter(DataTablesFilterType.DateTimeRange)] as in the example, then the pickers should have a time component.

If you don't want a time component, you can change your data source to map the DateTime columns to their date only values (.Select(x => new { SomeDate = x.SomeDateTime.Date, ... }), then I think the existing code should work.

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.

3 participants