fix: localization on date on browsers not in english

This commit is contained in:
Miguel Ribeiro
2025-04-16 21:30:14 +02:00
committed by GitHub
parent 4704ff9971
commit c7b3fb4451
3 changed files with 16 additions and 5 deletions

View File

@@ -18,11 +18,13 @@ if (isset($settings['color_theme'])) {
$colorTheme = $settings['color_theme'];
}
$locale = isset($_COOKIE['user_locale']) ? $_COOKIE['user_locale'] : 'en_US';
$formatter = new IntlDateFormatter(
$locale,
IntlDateFormatter::MEDIUM,
IntlDateFormatter::NONE
'en', // Force English locale
IntlDateFormatter::SHORT,
IntlDateFormatter::NONE,
null,
null,
'MMM d, yyyy'
);
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {

View File

@@ -1,3 +1,3 @@
<?php
$version = "v2.50.0";
$version = "v2.50.1";
?>

View File

@@ -213,6 +213,15 @@ $headerClass = count($subscriptions) > 0 ? "main-actions" : "main-actions hidden
</header>
<div class="subscriptions" id="subscriptions">
<?php
$formatter = new IntlDateFormatter(
'en', // Force English locale
IntlDateFormatter::SHORT,
IntlDateFormatter::NONE,
null,
null,
'MMM d, yyyy'
);
foreach ($subscriptions as $subscription) {
if ($subscription['inactive'] == 1 && isset($settings['hideDisabledSubscriptions']) && $settings['hideDisabledSubscriptions'] === 'true') {
continue;