In 5.8 all my custom date attribute values are "01.01.1970"
Permalink
Since I updated my site to 5.8 all my custom date attributes values are changed to and displayed as "01.01.1970". And I also cannot leave the attributes empty like before the update. Changes are ignored after saving.
In 5.7 everything worked fine with:
and
and
Different to that “CollectionDatePublic" works fine and its changes are saved
Is it about the database or do I have to change some code in the core files?
Thanks in advance.
Mathias
In 5.7 everything worked fine with:
$date = Loader::helper('date');
and
setlocale(LC_TIME, "de_DE.utf8");
and
Different to that “CollectionDatePublic" works fine and its changes are saved
Is it about the database or do I have to change some code in the core files?
Thanks in advance.
Mathias
I'm not sure if this will help, but Loader is deprecated in favor of: ... I believe...
Nope... :-(
But thank you very much...
But thank you very much...
1.1.1970 is time zero, and the rest works with $c->getCollectionDatePublic(), so $c->getAttribute('ernennung') must be returning 0 or null.
Ok, but how to display a custom date in C5.8?
Here: https://documentation.concrete5.org/api/class-Concrete.Core.Localiza...
And here: http://php.net/manual/en/function.date.php...
So "M Y D" is where you can supply your own custom PHP date format.
And here: http://php.net/manual/en/function.date.php...
So
$dh = Core::make('helper/date'); $dateTimeObject = $c->getAttribute("my_date_attribute"); $customDate = $dh->formatCustom("M Y D", $dateTimeObject); echo $customDate;
Ok thank you,
but 1. I cannot write that code for every single custom date. I got several dates (beginning of membership (mgl_dat), day of birth (geb), day of death (verst), days of distinction (ernennung) etc.) and
2. C5 doesn't display the dates in the form
Best Mathias
but 1. I cannot write that code for every single custom date. I got several dates (beginning of membership (mgl_dat), day of birth (geb), day of death (verst), days of distinction (ernennung) etc.) and
2. C5 doesn't display the dates in the form
Best Mathias
Hello again,
now I installed a brand new 5.8 version. I made a attribute (date) and filled the form. After saving the php displays 1.1.1970 and when I open up the edit form the field "date" is empty again.
Sorry, but this must be a bug.
I'll try 5.7 again to proof that.
Best Mathias
now I installed a brand new 5.8 version. I made a attribute (date) and filled the form. After saving the php displays 1.1.1970 and when I open up the edit form the field "date" is empty again.
Sorry, but this must be a bug.
I'll try 5.7 again to proof that.
Best Mathias
Please report bugs on the bug tracker at
http://www.concrete5.org/developers/bugs/8-1-0/...
(The core team don't browse the forums looking for reports such as yours, so this will go un-noticed unless you post it on the bug tracker)
http://www.concrete5.org/developers/bugs/8-1-0/...
(The core team don't browse the forums looking for reports such as yours, so this will go un-noticed unless you post it on the bug tracker)
Ok, thank you. I'll do that.
This would be my second bug-report. I even won a badge :-)
I just installed a new C5.7 and everything works fine. I guess I will make the new site with C5.7.
Best Mathias
This would be my second bug-report. I even won a badge :-)
I just installed a new C5.7 and everything works fine. I guess I will make the new site with C5.7.
Best Mathias
There were changes to the infrastructure for attributes from 5.7 to v8 to facilitate Express, though the new system is supposed to be backward compatible.