formio / formio.js

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

Date range picker doesn't consider the end date #4840

Open kuroh123 opened 2 years ago

kuroh123 commented 2 years ago

I set the mode to range but when I am selecting the date range, Its always only considers the first date. because of that, I can't access the last date. img

kuroh123 commented 2 years ago

image Here I am selecting the date range

image But its only considering the start date

FierceSimba commented 1 year ago

Hi kuroh123,

Were you able to find a solution/workaround to this issue? From what I can tell, this is an issue with the implementation of Flatpickr in form.io, as the range mode works on other sites and applications.

Additionally, I noticed another issue: if you click out of the datepicker after selecting your range, it either throws a random date or the selected starting date, getting rid of the range. Do you have the same issue?

Thanks, Fierce

kuroh123 commented 1 year ago

Hello Fierce,

Unfortunately I couldn't find any solution, I just went ahead and used two different date pickers for start date and end date.

About your other issue, I remember facing it, there is some JSON value of that date picker component which should be false but somehow it sets to true, try this - add a new date component and copy its JSON data and compare it with your bugged date component's JSON data, there should be some value which is set to true, just make it false.

FierceSimba commented 1 year ago

Thanks!

For the latter issue, it seems that enableTime must be true when using the range mode to keep the field populated correctly (although some others seem to have it the other way around).

I'm still looking into how to get the range saved, and will let you know if I come across anything that works.

dchiquettiwegner commented 3 months ago

any workaround this issue?

lane-formio commented 3 months ago

We don't currently support "mode": "range" but would happily consider any contribution to add this functionality.