- Issue created by @NicholasS
- πΊπΈUnited States NicholasS
This has been on our prod site for a few months as a local patch.
- Status changed to Needs review
almost 2 years ago 7:40pm 5 June 2023 - last update
almost 2 years ago 1 pass - last update
almost 2 years ago 1 pass - πΊπΈUnited States NicholasS
Here is a better patch that supports and daterange end value as well. In the webform configuration settings you would have to dates separated by a "/".
- Merge request !3Fix issues: 3203912 (Empty Datetime fields are inserting current date and... β (Closed) created by NicholasS
- last update
over 1 year ago 1 pass - last update
over 1 year ago 1 pass - πΊπΈUnited States NicholasS
I have been running the previous patch in prod for years, but recently switched to the "smart date" module so I updated this patch to handle both the daterange field and the smart date field.
You basically pass the dates start and end dates from the webform like this. With a /slash between the two dates.
[webform_submission:values:start_date_time:html_datetime_short:nolabel]/[webform_submission:values:end_date_time:html_datetime_short:nolabel]
- last update
about 1 year ago 1 pass - Status changed to Fixed
11 months ago 10:52am 15 May 2024 - π΅πΉPortugal joaomarques736
Hello NicholasS,
Many thanks for your support. I will merge these changes in the new release: 4.0.9.
Best regards.
- Status changed to Fixed
11 months ago 10:54am 15 May 2024 - πΊπΈUnited States timwood Rockville, Maryland
Sorry to comment on a closed issue but I just noticed that @nicholass suggestion above is no longer working for us. Specifically, an end date value is being stored in the database in the node date field as value
88365
if no end date is submitted to the webform. Maybe this is a unicode character? I have no default value set in the end date value on the node field, which is a core daterange field using the contrib optional_end_date module. Adding a node directly on the node add screen does not result in this weird value in the DB. Switching to the "default" field mapping with custom text no longer accounts for the/
in the custom text and includes it in the start value date on the node field.I tried a few different token values including the suggestion above which we've been using for a while:
[webform_submission:values:starting_date:html_date:nolabel]/[webform_submission:values:ending_date:html_date:nolabel]
[webform_submission:values:starting_date:raw]/[webform_submission:values:ending_date:raw]
[webform_submission:values:starting_date:raw]/[webform_submission:values:ending_date:raw:clear]
[webform_submission:values:starting_date:raw]
(even this one, where I do not include the slash or end date still results in
88365
in the database end date value.Here's a screenshot of the webform submission token suffix options showing
:clear
.