Change a DATETIME field to DATE (in MYSQL)
ALTER TABLE jos_content
CHANGE publish_down
publish_down
DATE NOT NULL DEFAULT '0000-00-00 00:00:00';
Open a content (with end publish date at empty) and see the field displays "30-11-2001 00:00:00" and doesn't display empty
empty in field calendar
"30-11-2001 00:00:00"
joomla 3.9.15, mysql
Because in the librairies/joomla/form/field/calendar.php file the getNullDate fonction return always the time??
// Format value when not nulldate ('0000-00-00 00:00:00'), otherwise blank it as it would result in 1970-01-01.
if ($this->value && $this->value != JFactory::getDbo()->getNullDate() && strtotime($this->value) !== false)
{ ...
Labels |
Added:
?
|
Title |
|
The calendar field is made for datetime, not for date database fields. Joomla core used datetime only (and on PostgreSQL timestamp withut time zone), not date.
So to be honest: I am not sure if this here is really an issue or a wrong usage of the calendar field.
I agree with you - its a date time field not a date field - at least as far as the definition of the field. Displaying of the date is a different issue and is down to the formatting of the data not how it is stored.
You certainly also need to adjust the calendar field format to not show the time. Also you need to remove the UTC filtering so no timezone is applied.
@brianteeman @Bakual So what do you suggest? Closing as no issue?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-13 07:08:41 |
Closed_By | ⇒ | brianteeman |
Closed for the reasons stated above
Computers use values to interpret date and time. In theory, "0000-00-00 00:00:00" is the time when Jesus Christ was born, but the first computers were invented over 1900 years later. This date is not null, but it has a value that just cannot be processed. ;)