Format a Date in Auto Listing

dbain 23 Oct, 2012
I'm using ChronoConnectivity 4.0 RC3.2 to display a simple form using the Front End List setting and selecting Auto Listing = Yes option. Is there somewhere I can put a command on that page that will change the output setting of my date? My start-date is outputting 1981-00-01 00:00:00 and I would like it to simply say 1981.

If I can't do this. Can you give me the code for doing it in the Custom Listing Settings tab?
Max_admin 23 Oct, 2012
Hi dbain,

Do you have a form connected to your connection ? if you have one then you can use the "Auto list row" to edit the row data before its printed using this code in a "Custom code" action:


<?php
$form->data['row']['date'] = date('Y', strtotime($form->data['row']['date']));
?>


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
dbain 24 Oct, 2012
So here is what I did based on what I think you told me. I created a form using Form Wizard. Dragged Custom Code from Core Actions. Configured it and added the following code:

<?php
$form->data['row']['date'] = date('Y', strtotime($form->data['row']['date']));
?>

Set the Mode to "Controller" and saved the form.

Then I went into my Connection under Front End Listing and put the name of my form in the bottom of the General tab where it says Auto List Row Event.

I then saved my connection. Dates till came out the way they had before. I must have done something wrong.
Max_admin 03 Nov, 2012
Sorry for not responding sooner!

and put the name of my form in the bottom of the General tab where it says Auto List Row Event.



Wrong, you should place the event name here (the one created in your form under the "on submit"), form name should be select under the "Admin Editing" or "Frontend Editing" tabs in the connection.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.