Refactor date-time conversions using qtranxf_intl_strftime
#1238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 withext-int
for\IntlDateFormatter
.Deprecations -> new versions
qtranxf_strftime
->qtranxf_intl_strftime
qtranxf_convertFormat
->qtranxf_convert_to_strftime_format_using_config
.qtranxf_convertTimeFormat
->qtranxf_get_language_config_date_time
.qtranxf_convertDateFormat
->qtranxf_get_language_config_date_time
.qtranxf_convertDateFormatToStrftimeFormat
->qtranxf_convert_date_format_to_strftime_format
.$before
and$after
arguments inqtranxf_format_date
andqtranxf_format_time
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.