- Posts: 13
- Thank you received: 0
Hi,
My site has a form created by a component called "Visforms", which contains a date field with a format like YYYY-MM-DD. This is something that, for some reasons, I cannot change.
Nevertheless, I would like that Table JX displays this date in the table as DD-MM-YYYY. This is something that seems to have no native solution.
I was thinking of adding a short conversion with a php code like:
$newDate = date("d-m-Y", strtotime($date));
Please Log in or Create an account to join the conversation.
Hi,
sure. Take a look at the for loop in components/com_grid/GridView.php, line 277. $column holds the field name, $podatek holds the data.
Please Log in or Create an account to join the conversation.
Thank you Tomaz for the advice. I checked the components/com_grid/layouts/GridView.php file and its loop starting at line 277.
I've spent a lot of time trying to intervene in the loop but I'm definitely not comfortable enough in coding and did not succeed in changing the date format.
I first started with this line
if ($column=F3) $newDate = date("d-m-Y", strtotime($podatek));
echo $newDate;
Please Log in or Create an account to join the conversation.
Hi! Comparison operator in PHP is ==.
try
if ($column==F3) ...
Please Log in or Create an account to join the conversation.
Doesn't work, even with == ...
I'm very close to give up ... and a bit desperate
Please Log in or Create an account to join the conversation.