No Code Attached Yet
avatar Ruud68
Ruud68
16 Dec 2022

Steps to reproduce the issue

use PHP version 8.1.x on your site
create (or change) a form calendar field by either removing the optional translateformat parameter (in that case it default to false, or setting it to false > translateformat="false"

Expected result

No deprecated message

Actual result

Deprecated: Function strftime() is deprecated in [root]/libraries/src/Form/Field/CalendarField.php on line 273

System information (as much as possible)

J4.2.6
PHP 8.1.13

avatar Ruud68 Ruud68 - open - 16 Dec 2022
avatar Ruud68 Ruud68 - change - 16 Dec 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 16 Dec 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Dec 2022
avatar brianteeman
brianteeman - comment - 16 Dec 2022
avatar chmst chmst - close - 16 Dec 2022
avatar chmst
chmst - comment - 16 Dec 2022

Closing as duplicate.

avatar chmst chmst - change - 16 Dec 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-12-16 11:45:18
Closed_By chmst
avatar joomdonation
joomdonation - comment - 16 Feb 2023

@Ruud68 Just saw this from the linked issue. In your case, if you use you a Calendar form field translateformat="false", you can prevent warning by adding filterformat attribute to the field. The filterformat must provide equivalent format with the format defined in format attribute of the field. For example

<field
	name="test"
	type="calendar"
	label="Test Calendar"
        format="%Y-%m-%d %H:%M:%S"
        filterformat="Y-m-d H:i:s"
	showtime="true"
	filter="user_utc"
/>

Hope this helps.

avatar Ruud68
Ruud68 - comment - 17 Feb 2023

Thanks Tuan for following up

Add a Comment

Login with GitHub to post a comment