Problem/Motivation
We use this module on a site that has an Event content type. There are events with both start and end dates, but also events that only have a start date (e.g., when the end date is not known yet).
In a view, we want to display all events that are either starting in the future or are currently running.
If the end date was mandatory, one could simply add a filter on the end date (>= now). But since the end date can be empty, we should respect both values: "If the end date is set, it must be in the future; if not, the start date should be in the future".
Proposed resolution
Provide a Views filter for date range fields with optional end dates that implements this behaviour.
Comments
Comment #2
mrshowermanComment #3
birk commentedFirst of sorry for the long wait, and thank you for taking the time supplying a well written patch for the issue!
But I think this is out of scope for the module.
The reasoning for this is, when #2794481: Allow end date to be optional is accepted into core, you should be able to uninstall the Optional End Date, and still maintain the same functionality without any hitches.
I think the idea is good, and it might have a place in the Datetime Extras module.
Comment #4
mrshowermanThanks for your feedback! I think you have good reasons not to include this in the module.
In fact I had been thinking about adding the feature to #2794481: Allow end date to be optional first, but then decided against it, because I didn't want to increase the scope of that issue and delay progress any further.
I'll check out Datetime Extras and/or file a new core issue, should 2794481 be committed some day.
Comment #5
mrshowermanSorry for the noise; but in the project where we make use of #2, we now needed a similar sort handler as well.
So I thought I'd upload the appropriate patch here, just for the sake of completeness.
Comment #6
mrshowerman#5 contained an unrelated change.