Date Problem #84
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#84
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I think I found another problem if I'm not missing something... The date doesn't get stored as it should be.
Can be recreated like that:
Component Builder 2.4.6
Joomla 3.7.2
PHP 5.6.26
Check that you use the correct data type DATETIME the date option does not work well with the Joomla date field, since it has time.
If I change to data type DATETIME, this happens as well.
The strange thing is that I have two identical fields with that configuration but different field names. One is working, the other is not.
If you added the second field after your first install of the component, you will need to uninstall the component and reinstall or add the SQL update for the field in the Editing the Joomla Component => Details => Version Updates to insure the the new field is added to the database.
Something like:
I did uninstall, compile/reinstall, but that doesn't change anything. So for both type datetime and date it doesn't work.
Hmmm that does not happen on my side, so you will need to give us a screen shot of the JCB field view in question or the code in the sql install file of the table that this field belongs to.
(Here images with date, but either date or datetime doesn't make any difference). The strange thing is that one field is working, but the other is not...
Endresult after saving:
Field 1:
Field 2:
What I forgot to say:
As you can see, it's exactly the same configuration. But anyhow it does display both dates in a different format, once xx-xx-xxxx and once xxxx-xx-xx.
This seems to work every time.
Joomla Calender type always stores time even if the xml format does not show time
When using Joomla calendar aways use DATETIME and insure you have the Other default set to 0000-00-00 00:00:00 even if your xml format is %d-%m-%Y
The xml format is only for display, not for storing to database, the Calendar type always stores as %Y-%m-%d %H:%M:%S
Joomla has date functions that are used to display the date, but I wrote a simple few functions that I use in my static helper class to deal with this: