Todays date as default value for Date Range filter? #4134
Replies: 2 comments 3 replies
-
What if you have two web parts. One which shows >= today, and one which shows < today? Then use a vertical web part to allow switching between them? For the one with <= you can use the date range filter. |
Beta Was this translation helpful? Give feedback.
-
@wobba I got to thinking that would it be possible to use deep linking in this? So I have a Search Results webpart which shows all events from a event calendar + Filter webpart connected to it with filters "Event Category" and "EventsRollUpStartDate" (with the Date Range template). Search Results webpart and the Filter webpart are also connected to a "Events"-vertical in the Search Verticals webpart. So when I click "Events" vertical I see all the events from oldest to newest, but I don't want to see past events when I click to "Events" vertical. Instead I want to see future events by default (EventsRollUpStartDate:>=TODAY) AND to have the option to search past events by using the "EventsRollUpStartDate" filter by setting older start date. For now I haven't found a way to do this, but would it possible to insert "todays date" somehow to the "EventsRollUpStartDate"-filter value in the deep link? If yes, then I would set the "Events"-vertical as a link and insert the deep link to it so when I click "Events"-vertical, it would have todays date selected as default in the filter and I would have the option to change that dates to something else if needed and searching events with Search box webpart would also work. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I would like to know is it somehow possible (or maybe in the future) to add today's date as default value for Date Range filter?
So I have a page where I have search results webpart which pulls Events from a site event calendar and it shows all events in ascending or descending order.
Ascending order is not good because it shows first all the past events and descending order is not good because it show first all the future events and when there are many past/future events, user might need to scroll down a lot to see the events that are coming in the next coming days.
Ideal solution would be to show only events that are today on in the future and use ascending order by default. I can do that by adding EventsRollUpStartDate:>=Today to the search query, but then I cannot use Date Range filter to search past events since the query only searches Events that are >=Today.
So I think only option would be a default value in the Filter webpart so that I would se today's date as default value and use Date Range filter and if the user wants to search older events, he could just select a different date from the Date Range filter.
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions