Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default values for date type fields inside elements: only 1st default value is set. #576

Open
MiguelVis opened this issue Sep 14, 2022 · 0 comments

Comments

@MiguelVis
Copy link

Hi all,

I have an issue regarding default values for date fields inside an elements field type.

The second date field (date_end) does not get the default value, only the first one (date_start).

JS is not complaining on console.

Any help please?

form:
  validation: loose

  fields:
   ...
    scheduling.type:
      type: elements
      label: EVENTS_PLUGIN.FREQUENCY_LABEL
      validate:
        required: true
      size: small
      default: one-time
      options:
        one-time: EVENTS_PLUGIN.ONE_TIME_SELECT_OPTION
        daily: EVENTS_PLUGIN.DAILY_SELECT_OPTION
        ...
      fields:
        one-time:
          ...
        daily:
          type: element
          fields:
            .date_start:
              type: date
              label: EVENTS_PLUGIN.START_DATE_LABEL
              default: "2099-01-01"
              validate:
                required: true
            .date_start_enabled:
              type: hidden
              value: true
            .date_end:
              type: date
              label: EVENTS_PLUGIN.END_DATE_LABEL
              default: "2099-01-01"
              validate:
                required: true
             ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant