refactor: use variable DEFAULT_TIMEZONE

This commit is contained in:
2025-10-08 20:52:40 +04:00
parent f1f056f7f3
commit 04a7e4c6eb
6 changed files with 16 additions and 8 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ setSecurityHeaders();
];
foreach($timezones as $name => $timezone):
$targetDateLocal = new DateTime(COUNTDOWN_TARGET_DATE, new DateTimeZone('Indian/Reunion'));
$targetDateLocal = new DateTime(COUNTDOWN_TARGET_DATE, new DateTimeZone(DEFAULT_TIMEZONE));
$targetDateLocal->setTimezone(new DateTimeZone($timezone));
// Vérifier si c'est un jour différent
+3 -3
View File
@@ -170,12 +170,12 @@ $liveStream = getLiveStream();
<i class="fas fa-calendar-alt"></i>
<?php
if (!empty(NEXT_LIVE_DATE)) {
$liveDate = new DateTime(NEXT_LIVE_DATE, new DateTimeZone('Indian/Reunion'));
$liveDate = new DateTime(NEXT_LIVE_DATE, new DateTimeZone(DEFAULT_TIMEZONE));
$dayFormatter = new IntlDateFormatter(
'fr_FR',
IntlDateFormatter::FULL,
IntlDateFormatter::NONE,
'Indian/Reunion',
DEFAULT_TIMEZONE,
IntlDateFormatter::GREGORIAN,
'EEEE d MMMM'
);
@@ -205,7 +205,7 @@ $liveStream = getLiveStream();
'fr_FR',
IntlDateFormatter::FULL,
IntlDateFormatter::SHORT,
'Indian/Reunion'
DEFAULT_TIMEZONE
);
echo $formatter->format($liveDate);
+4
View File
@@ -58,6 +58,10 @@ if (!defined('SITE_DESCRIPTION')) define('SITE_DESCRIPTION', 'Votre plateforme d
if (!defined('SITE_LOGO')) define('SITE_LOGO', 'img/logo.png');
if (!defined('SITE_FAVICON')) define('SITE_FAVICON', 'img/favicon.png');
// Configuration du fuseau horaire par défaut
// Liste des fuseaux disponibles : https://www.php.net/manual/fr/timezones.php
if (!defined('DEFAULT_TIMEZONE')) define('DEFAULT_TIMEZONE', 'Indian/Reunion');
// Réseaux sociaux
if (!defined('FACEBOOK_URL')) define('FACEBOOK_URL', '#');
if (!defined('X_URL')) define('X_URL', '#');
+4
View File
@@ -136,6 +136,10 @@ define('PRIORITY_CATEGORIES', [
// Favicon du site
// define('SITE_FAVICON', 'img/favicon.png');
// Fuseau horaire par défaut pour l'affichage des dates
// Liste des fuseaux disponibles : https://www.php.net/manual/fr/timezones.php
// define('DEFAULT_TIMEZONE', 'Indian/Reunion');
// =========================================
// Réseaux sociaux
// =========================================
+1 -1
View File
@@ -23,7 +23,7 @@ if (file_exists($config_default_file)) {
// Locale et fuseau horaire
setlocale(LC_TIME, 'fr_FR.UTF-8');
date_default_timezone_set('Indian/Reunion');
date_default_timezone_set(DEFAULT_TIMEZONE);
// Initialisation des catégories de vidéo depuis l'API
$peertube_categories = initCategories();
+3 -3
View File
@@ -160,12 +160,12 @@ setSecurityHeaders();
<i class="fas fa-calendar-alt"></i>
<?php
if (!empty(NEXT_LIVE_DATE)) {
$liveDate = new DateTime(NEXT_LIVE_DATE, new DateTimeZone('Indian/Reunion'));
$liveDate = new DateTime(NEXT_LIVE_DATE, new DateTimeZone(DEFAULT_TIMEZONE));
$dayFormatter = new IntlDateFormatter(
'fr_FR',
IntlDateFormatter::FULL,
IntlDateFormatter::NONE,
'Indian/Reunion',
DEFAULT_TIMEZONE,
IntlDateFormatter::GREGORIAN,
'EEEE d MMMM'
);
@@ -195,7 +195,7 @@ setSecurityHeaders();
'fr_FR',
IntlDateFormatter::FULL,
IntlDateFormatter::SHORT,
'Indian/Reunion'
DEFAULT_TIMEZONE
);
echo $formatter->format($liveDate);