I'm having a date field with an optional end date. The end date is set to not-required and default-empty. No matter what - when I edit the entity form - it saves the start date to the 'value2' column if I leave the end date empty. Is there a way to leave it NULL? Maybe through some alter mechanism or hook?

Thank you!

Comments

Charles Belov’s picture

This is a duplicate of my comment at #1635810.

The issue is not so simple. There can be multiple reasons for the lack of an end date:

1. Something begins, and will end when something else is put in its place, e.g., a policy.

2. Something begins, and will end on some future date when it's done, e.g., an open-ended stage run or construction with no fixed schedule.

For items 1 and 2, if there must be something in the end date, the most future date possible would seem to be most appropriate, e.g., Dec. 31, 9999, or whatever the maximum date value is. (Sorry if I'm setting us up for a Y10K problem.) Views could already test for this.

The ideal English date display for items 1 and 2 would be: Effective [start date]

3. Something begins, and will probably end on the same day, when the work for that day is done, e.g., a public hearing, or at worst case in the wee hours after midnight early the next morning.

4. There is also the idea that something is being published, and it will always have been published, but at some point it won't be particularly interesting that it's been published, e.g., a press release that is not about something that has a definite end time. (But we can't just drop the start and end dates off, because there are press releases that *do* concern matters with specific end times.)

For item 3 or 4, if there must be something in the end date, having the same start and end date would seem to be appropriate, and issue #1635810 would be needed to solve it.

The ideal English date display for items 3 and 4 would be: [start date]

For completeness:

5. There is a definite interesting, typically future, start date and a definite interesting end date, both known, e.g., definitely scheduled construction.

This of course is what date entry is best set up for, as there is no ambiguity, and is already solved. Enter the start and end date.

The ideal English date display would be: [start date] - [end date] or [start date] to [end date]
or [start date] through [end date]

6. The start date is in the relatively distant past. Whether or not it is known, there is no particular reason to display it, e.g., a bus route that is about to be discontinued.

In this case, it's easy to know what to put in for the end date, but not for the start date. Ideally, the start date would be the most past date it is possible to display in a Drupal date field, e.g., Jan. 1, 0001. Again, we would never want to display this date.

The ideal English date display would be: Through [end date]

That said, one could reasonably argue that item 6 is just a contrary way of stating item 1. Still, it would be nice to be able to express item 6 in case there's a use case, and to be consistent with how I'm proposing we handle end date.

I think it is too much to ask staff to have to put in Dec. 31, 9999, or put in identical times for start and end, so ideally in place of the check box Show End Date, there would instead be radio buttons:

* Indefinite end date (default default)
* Indefinite same-day end time
* Indefinite start date/definite end-date
* Definite start and end dates

where the default could be overridden by the administrator by content type.

It's a whole 'nother issue for #1 and #2 remembering to go back and put in an end date if and when it finally happens. While that's outside the scope of this discussion, use of a most-future end date would allow such cases to be easily reported to whoever is responsible for checking for the up-to-date-ness of the website.

Charles Belov’s picture

Michael_Lessard_micles.biz’s picture

Status: Active » Closed (works as designed)

My understanding in that the default end dates (copied from start date even if you ignore them) are necessary and are working as designed. The issue linked by Charles Belov just above discusses this.

You can ignore the end dates in Views I believe or at least it will not cause any issues when you invoke Start Date filtering or sorting.

I am suggesting this be marked as Closed (works as designed).