Fixed a date problem where the ^D macro was not working properly.

This commit is contained in:
JT Smith 2002-08-22 03:42:48 +00:00
parent b2edd00fa8
commit ef533cc56e
2 changed files with 11 additions and 13 deletions

View file

@ -195,7 +195,7 @@ sub epochToHuman {
$output =~ s/\%d/$value/g; $output =~ s/\%d/$value/g;
$output =~ s/\%D/$date[2]/g; $output =~ s/\%D/$date[2]/g;
if ($output =~ /\%w/) { if ($output =~ /\%w/) {
$day = getDayName($date[6]); $day = getDayName($date[7]);
$output =~ s/\%w/$day/g; $output =~ s/\%w/$day/g;
} }
#---hour stuff #---hour stuff
@ -301,19 +301,21 @@ sub getMonthName {
=cut =cut
sub getDayName { sub getDayName {
if ($_[0] == 1) { my $day = $_[0];
$day++;
if ($day == 1) {
return WebGUI::International::get(27); return WebGUI::International::get(27);
} elsif ($_[0] == 2) { } elsif ($day == 2) {
return WebGUI::International::get(28); return WebGUI::International::get(28);
} elsif ($_[0] == 2) { } elsif ($day == 3) {
return WebGUI::International::get(29); return WebGUI::International::get(29);
} elsif ($_[0] == 2) { } elsif ($day == 4) {
return WebGUI::International::get(30); return WebGUI::International::get(30);
} elsif ($_[0] == 2) { } elsif ($day == 5) {
return WebGUI::International::get(31); return WebGUI::International::get(31);
} elsif ($_[0] == 2) { } elsif ($day == 6) {
return WebGUI::International::get(32); return WebGUI::International::get(32);
} elsif ($_[0] == 2) { } elsif ($day == 7) {
return WebGUI::International::get(33); return WebGUI::International::get(33);
} }
} }

View file

@ -18,11 +18,7 @@ use WebGUI::Macro;
sub _replacement { sub _replacement {
my (@param, $temp); my (@param, $temp);
@param = WebGUI::Macro::getParams($_[0]); @param = WebGUI::Macro::getParams($_[0]);
if ($param[0] ne "") { $temp = epochToHuman(time(),$param[0]);
$temp = epochToHuman(time(),$param[0]);
} else {
$temp = localtime(time());
}
return $temp; return $temp;
} }