Problem/Motivation
Same issue related here https://www.drupal.org/project/single_datetime/issues/2982299. Issue was closed in that ticket but never addressed.
Whether using optional end date module or using the feature added in drupal 9.3x dev (https://www.drupal.org/project/drupal/issues/2794481) the validation in validateSingleDateTime() does not allow you to submit the form when selecting a future start date and no end date.
Steps to reproduce
Set up daterange field and simple date range field display and have optional end date select (by either method above). Select a future start date and no end date and submit form. You will be prompted with the follow error:
'The @title end date cannot be before the start date'
Proposed resolution
Check if end date submitted is null or blank and skip this validation check.
Remaining tasks
Create/submit patch
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3220093_optional_end_date_not_compatible.patch | 1.16 KB | billdaff |
Issue fork single_datetime-3220093
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
Comment #2
billdaff commentedI believe this should address this issue, worked for me on 1.8.0-beta1
Comment #3
billdaff commentedComment #6
keshavv commentedTest patch and confirmed its working good. Created MR for the same for easy merge. +1 for RTBC
Comment #7
jcnventuraTried this with the "Optional End Date" module, and the patch didn't work. This should support both options, or wait until #2794481: Allow end date to be optional is merged.