give deprecated function up + postpone git relative date format use

* replace strftime() by datefmt_create() and datefmt_format()
  
(formats:https://unicode-org.github.io/icu/userguide/format_parse/datetime/)
* postpone due to issue with git output locale in docker container
This commit is contained in:
thopic committed 2023-07-12 16:40:59 +02:00
1 parent d0ee343b45
commit 95a18a949a
2 files changed
+21 -8

No files matched your search

+10 -2
View File
@@ -1,5 +1,13 @@
<?php
$last_rev = exec('git log -1 --pretty=format:"%H" '.$this_file);
$mtime = exec('LANG="fr_FR.UTF-8" git log -1 --pretty="format:%cr" '.$this_file);
$mtime = exec('LANG="fr_FR.UTF-8" git log -1 --pretty="format:%ct" '.$this_file);
$fmt = datefmt_create(
'fr-FR',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Europe/Paris',
IntlDateFormatter::GREGORIAN,
'd MMMM Y à HH:mm:ss O'
);
?>
<p style="text-align:right;">Dernière mise à jour <a href="https://git.gnous.fr/gnous/main_website/commit/<?php echo $last_rev;?>" target="_blank"><?php echo $mtime; ?></a></p>
<p style="text-align:right;">Mis à jour le <a href="https://git.gnous.fr/gnous/main_website/commit/<?php echo $last_rev;?>" target="_blank"><?php echo datefmt_format($fmt, $mtime); ?></a></p>