Forums

If the date is null?

Rollo71 02 Aug, 2022
Hello everybody,
I have this little problem that is driving me crazy.
In the DB I have a table (tbDummy) with several entries. One of the fields is a date (regDate).
Now, in my CF I have a table list that correctly lists all the entries for me.
I would like to display the date field in the format dd / mm / YYYY and not YYYY-mm-dd
To do this I used a Text Field to which, in the Advance Setting, I set
the Value tag {date: d / m / Y $ (var: modTbDummy.regDate)}
It seems to work, the problem is that if in the DB the date is not present (NULL) in the
the table list still shows today's date, while, in this case, it shouldn't display anything.
Any idea how to do it?
Max_admin 08 Aug, 2022
To change the format you should use the "Display format" setting!

There is no setting to keep the field empty, you can make it disabled, and enable it if you need a value!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Colnem 09 Aug, 2022
Hi

I think that you are French (like me).

In table list, for your field, insert an HTML Element, and edit this:
<p>My date : <?php echo date("d/m/Y",strtotime($this->get("modTbDummy.regDate")));?></p>
You need to login to be able to post a reply.