Forums

Calender not recording correctly d-m-y

vismay 29 Jun, 2017
Hello,
In the field calendar I choose to see value as d-m-y that means for 1st july 2017 to have following output: 01-07-2017
But calendar shows me 1-7-2017

Basically I need always 2 characters for day, 2 for month and 4 for year.

It should be as per php that for setting d-m-y the date value is 01-07-2017, but in chronoform 6 is not working.
Thanks
GreyHead 29 Jun, 2017
Hi vismay,

I took a peek at the code and don't see an obvious way to do this in the datepicker settings. You can re-format the date after the form submits. Would that do what you need?

Bob
vismay 29 Jun, 2017
I have a strictly formatted module to fill and the date should be always 10 characters.

I think it's a bug, because the information of d and m is with leading zero.

GreyHead 29 Jun, 2017
Hi Vismay,

As I said, you could re-format the date after the form submits - would that do what you need?

Bob
vismay 29 Jun, 2017
Not really, because the value is written in database before the form submit... so I need to do it when I call the write to database event?
GreyHead 29 Jun, 2017
Hi Vismay,

How are you doing the database save? Yes, you would need to change the format before the save.

An alternative - not ideal - would be to use a different datepicker that gives you more control over the format; or possibly to use JavaScript to reformat the date when it is selected.

Bob
Max_admin 30 Jun, 2017
Hi vismay,

You can send me a message using the contact us page and I will send you a patch file for this.

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.