Date Input Box and Calendar has a small problem

Hi, there seems to be a small problem with date fields and calendars.

When I open a modal that includes a date box and retrieve a record into it, all the text inputs show data but the date box does not. I have checked all the date formats everywhere, they are all set to dd-MMM-yy.

Further, if I click the calendar, i get…

image

Any suggestions please???

What field type is that? Is it a date picker component or a regular html5 date input?

Its a normal Text Input of type date with a date picker option taken.

In recreating teh problem step by step, it was only when I set the field to format dd-MMM-yy, that the problem occurred.

image

You should either use a regular date field or a date picker component.
If you are using the date picker component, like in your case, your input is better to be set to type text.

Also, i think you’ve wrongly formatted your date.
Probably you want to use DD-MMM-YY or DD-MMM-YYYY

Hi Teodor, the definition for date format in a text input is different than the date format for a cell in a table. dd-MMM-yy is acceptable (according to the help icon) in a table cell but not in a text input, where, as you say, DD-MMM-YY is acceptable.

Anyway the changing to DD-MMM-YY did not result in an acceptable result. The 2 problems remain.

  1. the Date data will not populate into the text input from the underlying table, it shows as ‘dd/mm/yy’ instead of the data itself. The rest of the row data does populate correctly.

  2. The popup calendar still exhibits NaN’s .

Ok, done some more experiments and got a workable solution. When creating the form, the Form Generator populates each text input with a dynamic attribute sourced from a GetSingle. This has problems mention above and a couple more I have not mentioned. A workable solution, is to instead populate each text input with a setvalue.

For date fields, the NaN (in the calendar popup) can be got rid of if you make the text input as a text type, not date, and use the date picker. The subsequent popup calendar is perfect.

To do all this, the below procedure is attached to the button in the table that is opening the modal.

I already explained you this in my reply:

As for this:

I don't understand what do you mean. The form populates the inputs with values from a data source you selected in the UI. Adding setvalue there makes not sense and is not correct.

Hi Teodor, Point 1&2 above, I did follow your advice, without it I would not have guessed that making a text input for a date, to NOT be of type date was the way to go, probably a trap a lot of people like me fall into. But now that I know its ok for me.

Point 3, I did another experiment and it worked the way you have advised, I have tripped over myself somehow trying to get on top of the date issue.

Kind regards
BruceX