I have a content type (Basic page) and created two fields Start date and Optional Start date using Smart date range field type. I also created a field fieldset group and place both of the smart date range fields on the group. When creating a new content and I changed the Start date time it calculates the end time which is correct however it also affects the other field's end time. I figured that this is happening because I have two fieldset parents. The code we have in smart_date.js "setEndDate()" looks for the parents('fieldset'). I think we can fix this by using closest() or parents('fieldset').first()?

var wrapper = $(element).parents('fieldset')

CommentFileSizeAuthor
#2 3128818-2.patch500 bytesrjbautista
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rjbautista created an issue. See original summary.

rjbautista’s picture

FileSize
500 bytes

Attaching here the patch that I did.

Thank you!

rjbautista’s picture

Issue summary: View changes
rjbautista’s picture

  • mandclu committed fee294a on 8.x-2.x authored by rjbautista
    Issue #3128818 by rjbautista: Smart date duration field start onchange...
mandclu’s picture

Status: Active » Fixed

Having two Smart Date fields grouped in a fieldset seems like an edge case, as I don't understand why you couldn't allow two values in a single field. That said, it looks like an easy fix and doesn't appear to cause any other issues, so merging this in.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.