Add a format_date, format_time and format_datetime functions to pull from the localization settings and update a few places where the date/times are output to use them... need to change everywhere else in the codebase to use these functions too!

This commit is contained in:
james 2008-08-28 22:02:06 +00:00
parent 9995867f1d
commit c45edf34ec
3 changed files with 18 additions and 3 deletions

View File

@ -1106,4 +1106,19 @@ function theme_icon($icon) {
else
return "";
}
function format_date($d) {
global $config;
return date($config['dateformat'],strtotime($d));
}
function format_time($t) {
global $config;
return date($config['timeformat'],strtotime($t));
}
function format_datetime($dt) {
list($d,$t)=split(" ",$dt);
return format_date($d)." ".i18n("at")." ".format_time($t);
}
?>

View File

@ -382,7 +382,7 @@
if($datecheck->datecheck==0)
{
if($datecheck->datecheckbefore)
echo notice(i18n("Registration for the %1 %2 is not open yet. Registration will open on %3.",array($config['FAIRYEAR'],$config['fairname'],$config['dates']['regopen']),array("fair year","fair name","registration open date")));
echo notice(i18n("Registration for the %1 %2 is not open yet. Registration will open on %3.",array($config['FAIRYEAR'],$config['fairname'],format_datetime($config['dates']['regopen'])),array("fair year","fair name","registration open date")));
else if($datecheck->datecheckafter)
{
echo notice(i18n("Registration for the %1 %2 is now closed. Existing registrants can login and view (read only) their information, as well as apply for special awards (if applicable).",array($config['FAIRYEAR'],$config['fairname']),array("fair year","fair name")));

View File

@ -218,7 +218,7 @@ else
{
list($d,$t)=split(" ",$config['dates']['postwinners']);
echo "<h2>".i18n("%1 Winners",array($config['FAIRYEAR']))."</h2>";
echo i18n("Winners of the %1 %2 will be posted here on %3 at %4",array($config['FAIRYEAR'],$config['fairname'],$d,$t));
echo i18n("Winners of the %1 %2 will be posted here on %3 at %4",array($config['FAIRYEAR'],$config['fairname'],format_date($d),format_time($t)));
$first=false;
}
//get the "winnersposted" date for the year, and make
@ -254,7 +254,7 @@ else
{
list($d,$t)=split(" ",$config['dates']['postwinners']);
echo "<h2>".i18n("%1 Winners",array($config['FAIRYEAR']))."</h2>";
echo i18n("Winners of the %1 %2 will be posted here on %3 at %4",array($config['FAIRYEAR'],$config['fairname'],$d,$t));
echo i18n("Winners of the %1 %2 will be posted here on %3 at %4",array($config['FAIRYEAR'],$config['fairname'],format_date($d),format_time($t)));
}
}