Problem/Motivation

When two or more date fields are added to the same form, but with different formatters, the smart date library for each element does not load properly.

Steps to reproduce

  1. Add 2 Smart date range fields to the same content type.
  2. Save all default field settings.
  3. In the content type display form, configure the fields as follows:
    • The first with the Smart date | Inline range formatter. In the widget settings:
      • Uncheck "Hide the end date field unless it's different from the start date."
      • Check Provide a checkbox to make an event all day.
      • Check Remove any seconds, if present, from existing values.
      • Check Use an overlay to display duration options.
    • The second as Smart date | Date-only range. In the widget settings:
      • Uncheck "Hide the end date field unless it's different from the start date."
      • Uncheck Provide a checkbox to make an event all day.
      • Check Remove any seconds, if present, from existing values.
      • Uncheck Use an overlay to display duration options.
  4. Now navigate to the form to add content of that content type and check the display.
  5. To see the differences, return to the form display, hide one of the date fields, show the other, and vice versa.

Example:

Displaying the two fields:
Form with two fields
Hiding field 2:
Form with field 1
Hiding field 1:
Form with field 2

CommentFileSizeAuthor
date 1.png9.4 KBjavier_rey
date 2.png7.21 KBjavier_rey
two dates .png21.15 KBjavier_rey

Issue fork smart_date-3549899

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

javier_rey created an issue. See original summary.

javier_rey’s picture

Title: Error having more than one smart date field in the same form. » Error having more than one smart date field in the same form

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