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

Date only field endless countdown when form initialized with data #1223

Closed
vladislav-karamfilov opened this issue Jul 26, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@vladislav-karamfilov
Copy link
Contributor

vladislav-karamfilov commented Jul 26, 2024

Describe the Bug

When initializing a form with some data and the form contains a date only field (a component of type datetime and subtype date) and the component value is passed in the form data (for example 2024-07-24), an endless countdown of the dates begins and never stops.

All library versions after 1.7.1 behave like this. v1.7.1 stops the countdown at some date that is not correct.

IMPORTANT DETAIL: this bug is only (?) reproducible with time zone (UTC-06:00) Central Time (US & Canada). Works OK with Bulgarian timezone (UTC+02:00) but all our clients are in the US and use the Central Time TZ

Steps to Reproduce

  1. Copy the following code in some index.html file:
<html>
<head>
  <link rel="stylesheet" href="https://unpkg.com/@bpmn-io/[email protected]/dist/assets/form-js.css">
</head>
<body>
  <div id="form"></div>
  <script src="https://unpkg.com/@bpmn-io/[email protected]/dist/form-viewer.umd.js"></script>
  <script>
    async function init() {
      const container = document.querySelector('#form');
      let form = await FormViewer.createForm({
        container,
        schema: { components: [], type: 'default' }
      });

      const schema = {
        "components": [
          {
            "subtype": "date",
            "dateLabel": "Date",
            "label": "Date time",
            "type": "datetime",
            "layout": {
              "row": "Row_0d18n2g",
              "columns": null
            },
            "id": "Field_1lwhnt4",
            "key": "datetime_a5ocm9"
          },
          {
            "action": "submit",
            "label": "Button",
            "type": "button",
            "layout": {
              "row": "Row_0a8960z",
              "columns": null
            },
            "id": "Field_190m4tx"
          }
        ],
        "type": "default",
        "id": "Form_0238ts0",
        "exporter": {
          "name": "form-js (https://demo.bpmn.io)",
          "version": "1.8.3"
        },
        "schemaVersion": 16
      };
      await form.importSchema(schema, { datetime_a5ocm9: '2024-07-24' });
    }

    init();
  </script>
</body>
</html>
  1. Open the index.html file with a browser
  2. Observe that the date input changes its value all the time counting down

Expected Behavior

The input doesn't change its value all the time and it's correctly populated with the date that's passed in the data object.

Environment

  • Host (Browser/Node version), if applicable: Chrome 127
  • OS: Windows 11
  • Library version: 1.9.0 (but every version >= 1.7.1 has the bug)
@Skaiir
Copy link
Contributor

Skaiir commented Aug 14, 2024

Closed via #1234

@Skaiir Skaiir closed this as completed Aug 14, 2024
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Aug 14, 2024
@renzpatriarca
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants