Skip to content

DateTimeField value not included in search if time is excluded #2125

@GuySartorelli

Description

@GuySartorelli

If a DateTimeField is in the "search options" dropdown for searching, and a date is entered without a time, clicking search will simply omit the date entirely. For example in the campaign admin section (after CMS 6.2 which adds a search filter here with a DateTimeField by default):

Image

If there are no other search filters, this acts the same as though clearing search - i.e. it loads the default set of records. If there are other search filters, the search happens with those filters but with the date excluded.
There is no feedback to the user that part of their search filters have been excluded or that they entered incomplete data.

Possible solutions

  • Don't submit if the data is incomplete (preferably including a validation error
  • Default to 00:00 for the time
  • At the very least clear out the date from the field after clicking "Search" so it's more obvious that wasn't included (though that still doesn't really point out that they missed the time segment)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions