Skip to content

Commit

Permalink
localize dateformatter
Browse files Browse the repository at this point in the history
customize dateformatter to add choice of localized day
  • Loading branch information
dwblmo committed Jul 20, 2023
1 parent bbee21c commit b7d5b04
Show file tree
Hide file tree
Showing 19 changed files with 78 additions and 74 deletions.
10 changes: 10 additions & 0 deletions lmo/init.php
Expand Up @@ -64,6 +64,16 @@
//Configuration
require(PATH_TO_LMO."/lmo-cfgload.php");

//Dateformat
$fmt = new IntlDateFormatter(
'de-DE',
IntlDateFormatter::FULL, /*Datum */
IntlDateFormatter::SHORT, /*Uhrzeit */
$cfgarray['timezone'],
IntlDateFormatter::GREGORIAN,
$cfgarray['defdateformat']
);

//Language
if(isset($_GET["lmouserlang"])){
$_SESSION["lmouserlang"]=$_GET["lmouserlang"];
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Cestina.txt
Expand Up @@ -581,6 +581,10 @@
600=Versiune Bootstrap
601=Versiunea Chart.js
602=Versiunea BootstrapIcon
700=So.
701=Sobota
702=srp.
703=srpen
1000=serie
1001=Câștigat
1002=Neînvins
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Deutsch.txt
Expand Up @@ -582,6 +582,10 @@
600=Bootstrap-Version
601=Chart.js-Version
602=BootstrapIcon-Version
700=Sa.
701=Samstag
702=Aug.
703=August
1000=Serien
1001=Gewonnen
1002=Ungeschlagen
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-English.txt
Expand Up @@ -581,6 +581,10 @@
600=Bootstrap version
601=Chart.js version
602=BootstrapIcon version
700=Sat.
701=Saturday
702=Aug.
703=August
1000=Series
1001=won
1002=not lost
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Espanol.txt
Expand Up @@ -581,6 +581,10 @@
600=Bootstrap versión
601=Chart.js versión
602=BootstrapIcon versión
700=Sáb.
701=Sábado
702=Ago.
703=Agosto
1000=serie
1001=ganado
1002=Invicto
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Francais.txt
Expand Up @@ -581,6 +581,10 @@
600=Bootstrap version
601=Chart.js version
602=BootstrapIcon version
700=Sam.
701=Samedi
702=Ao.
703=Août
1000=series
1001=victoire
1002=invaincu
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Italiano.txt
Expand Up @@ -584,6 +584,10 @@
600=Versione bootstrap
601=Versione Chart.js
602=Versione BootstrapIcon
700=Sab.
701=Sabado
702=Ago.
703=Agosto
1000=serie
1001=Vinto
1002=Imbattuto
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Magyar.txt
Expand Up @@ -581,6 +581,10 @@
600=Bootstrap verzió
601=Chart.js verzió
602=BootstrapIcon verzió
700=szo.
701=szombat
702=aug.
703=augusztus
1000=sorozat
1001=Nyert
1002=Veretlen
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Nederlands.txt
Expand Up @@ -581,6 +581,10 @@
600=Bootstrap-versie
601=Chart.js-versie
602=BootstrapIcon-versie
700=Za.
701=Zaterdag
702=Aug.
703=augustus
1000=reeks
1001=Won
1002=Ongeslagen
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Norsk.txt
Expand Up @@ -581,6 +581,10 @@
600=Bootstrap-versjon
601=Chart.js-versjon
602=BootstrapIcon versjon
700=lør.
701=lørdag
702=aug.
703=august
1000=serie
1001=Vunnet
1002=Ubeseiret
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Portugues.txt
Expand Up @@ -581,6 +581,10 @@
600=Versão de inicialização
601=Versão Chart.js
602=Versão do BootstrapIcon
700=Sab.
701=Sábado
702=Ago.
703=Agosto
1000=série
1001=Ganhou
1002=Invicto
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Romanian.txt
Expand Up @@ -581,6 +581,10 @@
600=Versiune Bootstrap
601=Versiunea Chart.js
602=Versiunea BootstrapIcon
700=sam.
701=sâmbătă
702=Aug.
703=August
1000=serie
1001=Câștigat
1002=Neînvins
Expand Down
4 changes: 4 additions & 0 deletions lmo/lang/lang-Slovenskega.txt
Expand Up @@ -581,6 +581,10 @@
600=Različica Bootstrap
601=Različica Chart.js
602=Različica BootstrapIcon
700=sob.
701=sobota
702=avg.
703=avgusta
1000=serija
1001=Zmagal
1002=Neporažen
Expand Down
40 changes: 0 additions & 40 deletions lmo/lmo-adminbasic.php
Expand Up @@ -272,46 +272,6 @@
<div class="col-5 text-end"><acronym title="<?php echo $text[254];?>"><?php echo $text[253];?></acronym></div>
<div class="col-1 text-start"><input type="checkbox" class="form-check-input" name="xdatm" onChange="dolmoedit()"<?php if($datm==1){echo " checked";}?>></div>
</div>
<div class="row pb-1">
<div class="col-5 text-end"><acronym title="<?php echo $text[256];?>"><?php echo $text[257];?></acronym></div>
<div class="col-5 text-start">
<input type="radio" class="form-check-input" name="xdatfselect" value="1" checked>
<select class="custom-select" name="xdatf" onChange="dolmoedit();document.getElementsByName('xdatfselect')[0].checked=true;"><?php
$dummf=array("d.m. H:i", "d.m.Y H:i", "D., d.m. H:i", "l, d.m. H:i", "D., d.m.Y H:i", "l, d.m.Y H:i");?>
<option value="">__</option><?php
for($y=0;$y<count($dummf);$y++){?>
<option value="<?php echo $dummf[$y]?>"<?php if($datf==$dummf[$y]){echo " selected";}?>><?php echo date($dummf[$y], time())?></option><?php
}?>
</select>
</div>
</div>
<div class="row pb-1">
<div class="col-5 offset-5 text-start">
<input type="radio" class="form-check-input" name="xdatfselect" value=""<?php if (!in_array($datf,$dummf)) echo " checked";?>>
<input type="text" class="custom-control" name="xdatf2" onChange="dolmoedit();document.getElementsByName('xdatf')[1].checked=true;" value="<?php echo $datf?>">
<a href="https://www.php.net/manual/de/datetime.format.php" class="none">
<span class="popup">
<strong><?php echo $text[545];?></strong><br>
D = <?php echo date("D", time());?><br>
l = <?php echo date("l", time());?><br>
<strong><?php echo $text[546];?></strong><br>
d = <?php echo date("d", time());?><br>
j = <?php echo date("j", time());?><br>
<strong><?php echo $text[547];?></strong><br>
m = <?php echo date("m", time());?><br>
M = <?php echo date("M", time());?><br>
F = <?php echo date("F", time());?><br>
<strong><?php echo $text[548];?></strong><br>
y = <?php echo date("y", time());?><br>
Y = <?php echo date("Y", time());?><br>
<strong><?php echo $text[549];?></strong><br>
H = <?php echo date("H", time());?><br>
i = <?php echo date("i", time());?><br>
A = <?php echo date("A", time());?><br>
</span>
?</a>
</div>
</div>
<div class="row pb-1">
<div class="col-5 text-end"><acronym title="<?php echo $text[252];?>"><?php echo $text[251];?></acronym></div>
<div class="col-1 text-start"><input type="checkbox" class="form-check-input" name="xdats" onChange="dolmoedit()"<?php if($dats==1){echo " checked";}?>></div>
Expand Down
40 changes: 12 additions & 28 deletions lmo/lmo-adminoptions.php
Expand Up @@ -151,40 +151,24 @@
<div class="row align-items-center pb-1">
<div class="col-5 text-end"><acronym title="<?php echo $text[256] ?>"><?php echo $text[257]; ?></acronym>&nbsp;</div>
<div class="col-7 text-start">
<input type="radio" class="form-check-input" name="xdefdateselect" value="1" checked>
<select class="custom-select" name="xdefdateformat" onChange="dolmoedit();document.getElementsByName('xdefdateselect')[0].checked=true;"><?php
$dummf=array("d.m. H:i", "d.m.Y H:i", "D., d.m. H:i", "l, d.m. H:i", "D., d.m.Y H:i", "l, d.m.Y H:i");?>
<option value="">__</option><?php
for($y=0;$y<count($dummf);$y++){?>
<option value="<?php echo $dummf[$y]?>"<?php if($defdateformat==$dummf[$y]){echo " selected";}?>><?php echo date($dummf[$y], time())?></option><?php
}?>
</select>
</div>
</div>
<div class="row align-items-center pb-1">
<div class="col-5 text-end"></div>
<div class="col-7 text-start">
<input type="radio" class="form-check-input" name="xdefdateselect" value=""<?php if (!in_array($defdateformat,$dummf)) echo " checked";?>>
<input type="text" class="custom-control" name="xdefdateformat2" onChange="dolmoedit();document.getElementsByName('xdefdateselect')[1].checked=true;" value="<?php echo $defdateformat?>">
<a href="https://www.php.net/manual/de/datetime.format.php" class="none">
<input type="text" class="custom-control" name="xdefdateformat2" value="<?php echo $defdateformat?>">
<a href="https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax" class="none">
<span class="popup">
<strong><?php echo $text[545];?></strong><br>
D = <?php echo date("D", time());?><br>
l = <?php echo date("l", time());?><br>
E = <?php echo $text[700];?><br>
EEEE = <?php echo $text[701];?><br>
<strong><?php echo $text[546];?></strong><br>
d = <?php echo date("d", time());?><br>
j = <?php echo date("j", time());?><br>
dd = 04<br>
<strong><?php echo $text[547];?></strong><br>
m = <?php echo date("m", time());?><br>
M = <?php echo date("M", time());?><br>
F = <?php echo date("F", time());?><br>
MM = 08<br>
MMM = <?php echo $text[702];?><br>
MMMM = <?php echo $text[703];?><br>
<strong><?php echo $text[548];?></strong><br>
y = <?php echo date("y", time());?><br>
Y = <?php echo date("Y", time());?><br>
Y = 2023<br>
YY = 23<br>
<strong><?php echo $text[549];?></strong><br>
H = <?php echo date("H", time());?><br>
i = <?php echo date("i", time());?><br>
A = <?php echo date("A", time());?><br>
HH = 21<br>
mm = 30<br>
</span>
?</a>
</div>
Expand Down
3 changes: 2 additions & 1 deletion lmo/lmo-dirlist.php
Expand Up @@ -124,7 +124,8 @@
echo " ".$liga['aktueller_spieltag'];
}
?></div>
<div class="col-2 text-start d-none d-lg-block"><?php echo date($defdateformat, filemtime(PATH_TO_LMO."/".$dirliga.$subdir.$liga['file_name']))?></div>
<div class="col-2 text-start d-none d-lg-block"><?php echo datefmt_format($fmt, filemtime(PATH_TO_LMO."/".$dirliga.$subdir.$liga['file_name']))?>
<?php //echo date($defdateformat, filemtime(PATH_TO_LMO."/".$dirliga.$subdir.$liga['file_name']))?></div>
</div><?php
}
if($liga_counter==0){echo "<div class='col'>[".$text[223]."]</div>";}
Expand Down
2 changes: 1 addition & 1 deletion lmo/lmo-savefile.php
Expand Up @@ -92,7 +92,7 @@
fputs($datei,"DatC=".$datc."\n");
fputs($datei,"DatS=".$dats."\n");
fputs($datei,"DatM=".$datm."\n");
fputs($datei,"DatF=".$datf."\n");
fputs($datei,"DatF=".$defdateformat."\n");
fputs($datei,"urlT=".$urlt."\n");
fputs($datei,"urlB=".$urlb."\n");
fputs($datei,"Plan=".$plan."\n");
Expand Down
5 changes: 3 additions & 2 deletions lmo/lmo-showkoresults.php
Expand Up @@ -76,8 +76,9 @@
}
if($datm==1){
if($mterm[$st-1][$i][$n]>0){
$dum1 = date($datf, $mterm[$st-1][$i][$n]);
$dum2 = date("d.m.y", $mterm[$st-1][$i][$n]);
//$dum1 = date($datf, $mterm[$st-1][$i][$n]);
$dum1 = datefmt_format($fmt, $mterm[$st-1][$i][$n]);
$dum2 = date("d.m", $mterm[$st-1][$i][$n]);
} else {
$dum1=$dum2="";
}?>
Expand Down
4 changes: 2 additions & 2 deletions lmo/lmo-showresults.php
Expand Up @@ -44,8 +44,8 @@
<div class="row"><?php
if ($datm == 1) {
if ($mterm[$st-1][$i] > 0) {
//$dum1 = datefmt_format($fmt, $mterm[$st-1][$i]);
$dum1 = date($datf, $mterm[$st-1][$i]);
$dum1 = datefmt_format($fmt, $mterm[$st-1][$i]);
//$dum1 = date($datf, $mterm[$st-1][$i]);
$dum2 = date("d.m.", $mterm[$st-1][$i]);
} else {
$dum1 = $dum2 = "";
Expand Down

0 comments on commit b7d5b04

Please sign in to comment.