StratusForms icon indicating copy to clipboard operation
StratusForms copied to clipboard

Date not displayed in form

Open qaudaffyazmi opened this issue 5 years ago • 2 comments

Hi guys,

I have a form with date field named FormDate. I use default html5 date picker by setting the type="Date" Here is the code sinppet from form.

<input id="FormDate" listFieldName="FormDate" type="Date"/>

But when I load back the data into form, the date field displayed "mm/dd/yyyy' instead of real date.

image

Here is what the json looks like in list, as well as the stored data in column/field FormDate

image

Any help and idea much appreciated. Thanks.

qaudaffyazmi avatar Jan 06 '20 01:01 qaudaffyazmi

Hmmm.. I've not tried and HTML5 date picker before, what happens if you just change it back to a normal input box?

mrackley avatar Jan 06 '20 17:01 mrackley

I think the HTML date input type uses the end-user's computer's local date format. So for en-us, it will display as mm/dd/yyyy. For other countries and languages you should get different formatting. Here is the specs:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date https://www.w3schools.com/tags/att_input_type_date.asp

Also, not all browsers support the date input, so you should use a "polyfill" for backwards compatibility if you need to support older browsers.

Lastly, there are many articles in the internet that discuss the intricacies of the date input:

http://html5doctor.com/the-woes-of-date-input/ http://form.guide/html5/html-input-type-date-format.html

danny8000 avatar Jan 07 '20 00:01 danny8000