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

Minimum and maximum date change every time the Day component is updated #5963

Open
nicola88 opened this issue Jan 2, 2025 · 2 comments
Open
Assignees

Comments

@nicola88
Copy link

nicola88 commented Jan 2, 2025

If you set the Maximum Day and/or Minimum Day fields under the Validation tab of a Day component, every time you change any component settings the maxDate and minDate fields are updated with the current values minus one or two days.

The behavior was originally observed with formiojs v4.21.4

screen-capture

How to reproduce

  1. Create a new form, for example using the Form Builder
  2. Add a Day component to the form
  3. Open the Validation tab and set the Maximum Day and Minimum Day fields with any combination of dates
  4. Save settings
  5. Open again the component settings and click on Save, without changing anything
  6. Check the values of the component maxDate and minDate in the form schema and the values should be different than before

Expected behavior

The original values should not updated automatically.

@nicola88 nicola88 changed the title Minimum and maximum date changed every time the Day component is updated Minimum and maximum date change every time the Day component is updated Jan 2, 2025
@valesceva
Copy link

Maybe the problem could be here:

component.maxDate = moment(component.maxDate, 'YYYY-MM-DD').toISOString();

There's some misleading between date and conversion with moment and isoString

@olgabann
Copy link

@nicola88 Thank you for reporting this issue. I am able to reproduce it and have logged a ticket for the backlog. We are always willing to review any contributions to resolve this issue from the open-source community.

For internal reference:
FIO-9614

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

3 participants