Problem/Motivation

Couldn't find any opened issue about this, but once I select "Hide the end date field unless it's different from the start date" on the field formatter, there's no way I can set a different end date, the field will be always hidden don't matter which option I select on the duration so I can never set a different end date.

Proposed resolution

Display the end date once you select "Custom" duration from the dropdown.

Remaining tasks

Test if this doesn't affect recurring dates or any other field formatter/widget.

Issue fork smart_date-3227751

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bbombachini created an issue. See original summary.

bbombachini’s picture

bbombachini’s picture

Title: No way of showing end date if I chose to "Hide the end date field unless it's different from the start date." on field formatter » No way of showing end date if 'Hide the end date field unless it's different from the start date'
mandclu’s picture

Status: Active » Needs review

Thanks for identifying this, and for providing a patch.

I confess that as someone deeply familiar with the inner workings of this module, I am aware that it is possible to expose the end date field by setting the time close enough to the end of the day that the end time will be on the next day, after which the end date can be changed as desired. I recognize that it isn't reasonable to expect a user to understand that process, however.

The only potential issue I have with your patch is setting the date to a null value, which seems like it could create some unexpected behaviour when validating or saving the values.

That said, I don't have the time available to test it right now, so marking this as "needs review" for now.

hip’s picture

Not sure if talking about same issue. I use 'custom' and '0' as the only allowed duration increments, being 0 the value by default. Once in the 'create a new node' form I can't access to a second date form field (only second time one). I choose 'custom' from the 'Duration' drop down but still only get the field for Date1, Time1 and Time2. No Date2 is shown.

damienmckenna made their first commit to this issue’s fork.

damienmckenna’s picture

Version: 3.4.0-beta2 » 4.2.x-dev

damienmckenna changed the visibility of the branch 3227751-show-end-date to hidden.

damienmckenna’s picture

I created a MR that works against the 4.2.x branch.

FYI this does not resolve the problem with the overlay option.

damienmckenna’s picture

Status: Needs review » Needs work

It does work with the overlay, but I think there's a bug in the logic - if I set the start time to 9pm and select a duration of 4 hours it does show the end date field, but if I manually edit the end time to 1am it does not show the date field.