Forums

Datepicker in chronoconnectivity displays NaN

ataylor14 05 Apr, 2017
Hello
I have a chronoconnectivity form which reads data from a table. I have a field in the table called 'startdate' of type "date" which is in the default format Y-m-d in the database.

I want to make this field editable. So I in the HTML box I tried to

a) add a text input field for that date:
Data.startdate:<input name="Data[{Data.id}][startdate]" id="dt_{Data.id}" value="{Data.startdate}" type="text" />

b) I also made this field of datepicker class and I set the format to be "Y-d-m"

However, the calendar does not work and the year and month appear as NaN.
I also checked the https://www.chronoengine.com/forums/posts/t102870/date-picker-not-working-on-edit-forms.html?keywords=datepicker%20edit%20field%20NaN
but it did not help me.

Could you please help?
Thank you
Amelia
Max_admin 05 Apr, 2017
Hi Amelia,

"So I in the HTML box I tried to", sorry, which HTML box exactly ?🙂

The syntax to call the value depends on where you call it, you can use your own field code as you did in #a, or you can create a "fields" view, and use a text field or calendar field, if you use a calendar field then the format should be set to Y-m-d

The field value should also be set correctly, but this depends on "where" you will call this fields view ?

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
ataylor14 05 Apr, 2017
I am in Admin - > Settings -> HTML
Display type is Table
ataylor14 05 Apr, 2017
Data is the name of the model, 'id' and 'startdate' are fields in the table which are part of the model.
They appear in the Columns List:

Data.id:ID
Data.startdate:Arrival

I want to make startdate to be editable so I added in the Admin->Settings->HTML
an entry for that as above.

I hope this makes more sense
Max_admin 05 Apr, 2017
Hi Amelia,

Please show me a screenshot, there is no "Admin->Settings->HTML" path in v6

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
ataylor14 05 Apr, 2017
Sorry I have v5. I made a mistake in the tag of this question. Apologies
Max_admin 06 Apr, 2017
Hi Amelia,

No problems, are you able to build this connection in v6 instead ?

But your code in #a should work, the {Data.startdate} should call the field value in the input in v5

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
ataylor14 15 Apr, 2017
Hello Max
Sorry for this delay. I was away.

I do not use v6 at all. I only have v5 installed.
See the image attached.
The 'Data' is the model name. 'startdate' is a field I read from a table and it is of type 'date'.
It looks that even if I set this field to be editabel as a 'text' it is recognised as a date.
But it seems the format of the date might case issued.

Originally I had this field as a datepicker and I set the format to be 'Y-m-d' but that did not solve this problem either.

If I change the field type in the structure of the table in phpmyadmin to 'varchar', then it works.But I do not want to go down that route.
Thank you for your help.
Amelia
Max_admin 15 Apr, 2017
Hi Amelia,

If the database field type is "date" then the datepicker format should be set to "Y-m-d", you may also use a normal text field and ignore the format.

If you can build this connection in v6 then you will have more control over the view, and there is a fields wizard included.

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.