Searching by date and not date and time

In my application i have a page that allows users to create events which means they must choose a date and time of the event. I also have a search page that allows for users to search for events in their area. On the search page I want to only search by date and not time so the search is not so specific is this possible?

Sure. How you do it just depends on what criteria you want users to be able to use.

You need to understand and keep in mind that a date object is ALWAYS a date/time object.

So, if you let a user select a date to check against, you may need to first manipulate its time parts to ensure the right results.

I discuss this in some detail here:

In general an event will be inside of a range bounded by datetime1 and datetime2 if:

datetime2<- range ->datetime1 contains point event’s:startDateTime

Does that help get you started?

I’ve been programming time and attendance softwares since many years.
My advise is to use one text field for the date YYYYMMDD and one texte field for the time HHMMSS.
If needed you can also keep the original field in date/tyime format but for display purpose only.
Each time you create a new thing, it’s easy to fill those two first fields.
With the first two fields it’s definitly more easy to filter in all cases.
You can do the same if you need to filter on the weeKs, quarter etc…

1 Like