Default date element time to 00:00:00

jo-ka

Member
Hello.

I understand that the element Date is in fact a datetime database field. When using the date element to select a date, even if I have no time selection, the date value always returns the time with the current time.

Is there a way to set an element property to always have the time like 00:00:00?

I'll need this because I need to filter the fields based on dates and sometimes the results are incorrect because of this time.

A solution could be manually set the database field type to date, but every time we make a change to the date element, the database field is automatically updated to datetime again.



Any suggestion?

Thanks in advance.
 
Did you try with
default (eval) = return date('Y-m-d 00:00:00');
and Time selector =off
This should store all dates with time 00:00:00

Maybe you have to set Date format = local time, too.
I didn't test which date is stored if you are storing the date e.g. at 1am (where UTC is still one day behind).
 
Dear Troester,
The date was already set up to Local time.

Your approach is OK, and probably I'll need to set it like this.
I would prefer not to have a predefined date, but if this is the only option, I can live with it.

Thanks.
 
You don't need a default (I thought you wanted one).
Set time selector off (and no time format for forms).
 
hmmm, and it's still showing times <> 00:00 in new records?
I assume in existing records it may be necessary to set the time to 00:00 manually (e.g. phpmyadmin)
 
I can't replicate.
On my site it doesn't show any time before or after clicking into the date field (with form date format = d-m-Y)
(and saving an existing record which had a time set before the time is set to 00:00 after save).

Did you clear Joomla and browser cache?
Which exact Joomla and Fabrik?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top