-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.2] CalendarField: changing strftime to date #44114
Conversation
Can you give us exact test instructions? I have forgotten what happened previously and I cannot reproduce the error in 5.2.0-beta3-dev. |
I get the message only with PHP < 8.2. The patch works as described for this field, but did not test with other configurations. and not sure if this is a good solution. Field definition in my component.
@ceford for a test, change the field definiton in a compoment, for example in com_content, article.xml like this or with all possible different settings:
and different php versions |
Solution of Chat GPT: php You can replace it with the DateTime object or the date() function as follows: php // Or using the date() function |
The solution provided I do not consider a proper solution. I don't want to change the configuration of xml manifest field. |
Hi, |
@aberenguer78 Can you open https://issues.joomla.org/tracker/joomla-cms/44114 and
The test will count as successfull. |
I have tested this item ✅ successfully on bc5ba11 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44114. |
I have tested this item ✅ successfully on bc5ba11 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44114. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44114. |
Thanks @Hackwar ! |
Pull Request for Issue #42790 and a lot more.
Summary of Changes
When using the calendar field without a format and without setting
translateformat="true"
, the field tries to convert the value withstrftime()
, which is deprecated and throws a warning. This PR replacesstrftime()
withdate()
instead and converts the time format from strftime to date-format. To make this as compatible as possible, the conversion method has been extended to include as many conversions as possible. Since this only converts datetimes, the chance that someone is using a format with additional text besides the strftime-format is neglectable.Testing Instructions
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed