hello i have strange problem with calendar custom field ...
1 i create one date field no specific configuration
2 but date isn't good in backend and i didn't find where in can change format ...
3 if user set a date via selector that display 10-02-2022 for 10 feb 2022 (french format) that display in front 2 october 2022
I didn't think its an output problem because if is set 24-02-2022 (24 feb 2022)
in front it crashed because systeme think month number 24 that doesn't exist ....
Some body can confirm ?
Bug config problem ?
Labels |
Added:
No Code Attached Yet
|
Which version of the language pack are you using?
The format is converted using four language strings provided by the language pack. You may want to check those:
DATE_FORMAT_CALENDAR_DATE="%d-%m-%Y"
DATE_FORMAT_CALENDAR_DATETIME="%d-%m-%Y %H:%M:%S"
DATE_FORMAT_FILTER_DATE="d-m-Y"
DATE_FORMAT_FILTER_DATETIME="d-m-Y H:i:s"
These are taken from the official pack from https://downloads.joomla.org/de/language-packs/translations-joomla4/downloads/joomla4-french/4-0-6-1 and look correct.
Can you also check what is stored in the database? Should be in the english format (2022-02-10)
Labels |
Added:
Information Required
|
Please post what value for this language constants on your admin/site:
DATE_FORMAT_CALENDAR_DATE
DATE_FORMAT_CALENDAR_DATETIME
DATE_FORMAT_FILTER_DATE
DATE_FORMAT_FILTER_DATETIME
You can try search them in language override
DATE_FORMAT_CALENDAR_DATE = "%d-%m-%Y"
DATE_FORMAT_CALENDAR_DATETIME = "%d-%m-%Y %H:%M:%S"
DATE_FORMAT_FILTER_DATE ="d-m-Y"
DATE_FORMAT_FILTER_DATETIME = "d-m-Y H:i:s"
seems correct
hm yes, strange then why it fail
lol i take many time to find why item is failed ... lol
tahnks for your help
What value for DATE_FORMAT_LC3
?
and what happen if you just do echo HTMLHelper::_('date', $blablaDateValue)
(without use of format)?
What's the value of DATE_FORMAT_LC3? If you use that for creating your date, it has to be the ISO format?
Since the calendar field apparently stores the date correctly into the database in format YYYY-MM-DD, and the calendar field also correctly shows the date again, something must be wrong with your code to display the date in frontend.
I doubt the issue is the DATE_FORMAT_LC3 either, as that one should not create such issues when being wrong.
I rather suspect your $this->item->arbitrary_property_name['date-de-parution']->value
doesn't hold the date as it is in the database but is already transformed to another format, which is why the date function then breaks.
This value has to be in the format YYYY-MM-DD.
Joomla always expects YYYY-MM-DD. The same as is stored in the database. So you need to check your code why the value is already localised. You probably already applied the date format on that property and now try to apply it a second time, which fails.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-02-14 08:01:19 |
Closed_By | ⇒ | micker |
ok thanks i close this thank for all
@Fedik Any idea?