qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
554 stars 105 forks source link

Refactor date-time conversions using `qtranxf_intl_strftime` #1238

Closed herrvigg closed 2 years ago

herrvigg commented 2 years ago

The strftime function is deprecated in PHP8.1. Generalize usage of qtranxf_intl_strftime for any PHP version. The old implementation is condemned so no point to maintain it. Eventually the strftime format may disappear but this requires more work.

Abandon support of ML date-time formats. The use case is very unclear and looks like very old legacy code. Simplify the code by assuming the format is only for the current lang.

Bump minimal PHP version to 5.5. Required by \DateTimeInterface. Update composer with ext-int for \IntlDateFormatter.

Deprecations -> new versions

Fix missing use case when using STRFTIME format if the user format is not given. Example get_the_date(). It should use the language format. Before this patch it didn't.

herrvigg commented 2 years ago

Related to #1085 #1228 #1234.