formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.83k stars 1.04k forks source link

DateTime Component do not respect given format when rendering in HTML Mode #5531

Open Leeloo5E opened 4 months ago

Leeloo5E commented 4 months ago

Describe the bug Different representation in DateTime Component for selected date and rendered date while rendering in html mode

Selected Date: 08.03.2024 Rendered Date in HTML mode: 2024-03-07T23:00:00.000Z

Version/Branch

├── @formiojs@4.18.2

To Reproduce Steps to reproduce the behavior:

  1. Create new form
  2. Add component date time and choose a different format like 'dd.MM.yyyy'
  3. Use form an put in a date in the given date time field, e.g. 08.03.2024
  4. Choose renderMode = 'html'
  5. Date is rendered in other format: 2024-03-07T23:00:00.000Z

Expected behavior Date should be rendered in the given format also in renderMode = 'html'

Screenshots

Choose Dates in different Timezone Selections (of Viewer, of Submission, of Location, UTC) -> look okay Bildschirmfoto 2024-03-08 um 14 03 25

Render everything with renderMode='html' --> back to default Bildschirmfoto 2024-03-08 um 14 04 16

Additional context I use formiojs together with angular/formio 7.0.0. In addition, I was able to recreate the same behavior in the sandbox as well as in a JSFiddle by only using formiojs independently of angular/formio -> https://jsfiddle.net/ytj8h70a