Jump to content

strftime PHP7.2 (solved)


mel47
 Share

Recommended Posts

Hi,
I updated recently to PW 3.0.233. My website is in french (default) and english. I realized all my dates became english on frontend. I didn't modify locale (fr_CA.UTF8) from languagesupport-module, neither anything from my template. Most used something like strftime('%A %d %b', $item->getUnformatted("date")).
An important information is that my prod server is still on PHP 7.2, so it should not normally be deprecated. Does something change in PW? Or what do I should changed at this time?
Thanks
Mel

Link to comment
Share on other sites

What was the version you updated from? We could use this to look for anything that has changed since then.

If this is a production site, I would advise against using the dev branch. The latest master version is 229 which should be stable for production.

Link to comment
Share on other sites

Hi,
From 3.0.126
Just realized I also have the date in english in backend (in lister for example). And also in another website (in backend but not frontend). Not sure if it was like this before since I never really have a date column in lister. This website in on a PHP7.4 version.
Thanks

 

Link to comment
Share on other sites

Hello,

since a recent version, and because strftime has been deprecated in PHP 8.1, month and day names must be translated in PW admin, in file /wire/core/WireDateTime.php.

Then you don't need to format date by yourself, it will be formatted according to field configuration.

  • Like 1
Link to comment
Share on other sites

  • mel47 changed the title to strftime PHP7.2 (solved)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...