formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

Formio date/time picker is returning one day of

Open usama967 opened this issue 3 years ago • 12 comments

I am using Form Io date/time picker but I unchecked the time component so that only the date will save on the database after unchecking the time's checkbox. It still sends the time along with the date in UTC like 2022-10-13T00:00:00+05:00 and while fetching the data from the server it converts it into the viewer's timezone like 2022-10-12T19:00:00.000Z. Payload: 2022-10-13T00:00:00+05:00 Response: 2022-10-12T19:00:00.000Z Formiojs version: 4.14.7

usama967 avatar Oct 11 '22 19:10 usama967

Hey @travist, our team is reporting this issue. Please let us know if this is added to formio dev backlog and if there is a way to track the progress.

JubayerJoy avatar Oct 26 '22 18:10 JubayerJoy

@JubayerJoy can you provide a form embed of the issue taking place?

wag110894 avatar Oct 26 '22 21:10 wag110894

Hey @wag110894, thank you for reaching out and apologies for the delay.

I have requested @usama967 to compose enough information to help you triage this. Our best guess is its happening due to an issue with flat picker date component.

JubayerJoy avatar Nov 02 '22 20:11 JubayerJoy

Hey @wag110894, Here is the link to the recorded video you can see the problem. Thanks https://www.loom.com/share/87042493d28a4d41884569f1b5878deb

usama967 avatar Nov 03 '22 12:11 usama967

Thanks for the video, what version of formio.js are you running?

wag110894 avatar Nov 03 '22 21:11 wag110894

@wag110894 Frontend: formiojs: "4.14.7", Backend: formiojs: "^4.15.0-rc.7",

usama967 avatar Nov 04 '22 05:11 usama967

@usama967: Did you get any response as a fix or at least as a workaround for you problem? I got the same issue here, each date saved through Form IO started to be persisted in DB as a date time since latest versions. We are using angular-formio 4.11.1 version which unfortunately has a non constant dependency on formiojs as described below: "angular-formio": { "version": "4.11.1", [ ...] "requires": { "formiojs": "^4.12.1", [...] }, "dependencies": { "formiojs": { "version": "4.14.10", [...] "requires": { [...] "moment": "^2.29.2", "moment-timezone": "^0.5.34", }, [...] "moment": { "version": "2.29.4", [...] } } },

I think moment 2.29.4 version could be the problem in our case. We didn't reproduce the problem on formiojs "4.14.7" - moment "2.29.3".

Thank you in advance!

magdacotoarba avatar Nov 28 '22 16:11 magdacotoarba

@magdacotoarba Unfortunately I didn't get any response. If I use moment = "2.29.3" and formiojs "4.14.7" will it be working fine?

usama967 avatar Nov 28 '22 17:11 usama967

Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!

daneformio avatar Feb 07 '24 14:02 daneformio

Should be fixed and not closed, this is definitely still relevant.

Hefaistos68 avatar Apr 03 '24 13:04 Hefaistos68

Are you able to reproduce this in the latest versions of the app? If so, can you provide an embed URL that our team can use to reproduce it?

daneformio avatar May 01 '24 13:05 daneformio

We are in the process of updating to the latest version, let's see.

Hefaistos68 avatar May 17 '24 16:05 Hefaistos68

Thank you for your contribution. As this issue has been inactive for over 90 days, I will close it for now. If you wish to reopen the issue, please respond and we can resume the triage process.

Sidiro23 avatar Sep 04 '24 13:09 Sidiro23