Fix epoch=0 issues with Session/DateTime and D_date macro.

Add an edge case test for D_date macro.
This commit is contained in:
Colin Kuskie 2009-12-01 17:08:12 -08:00
parent ae08335e9c
commit a7aa1d2fb2
3 changed files with 18 additions and 9 deletions

View file

@ -298,8 +298,11 @@ A string representing the output format for the date. Defaults to '%z %Z'. You c
=cut
sub epochToHuman {
my $self = shift;
my $epoch = shift || time();
my $self = shift;
my $epoch = shift;
if (!defined $epoch || $epoch eq '') {
$epoch = time();
}
my $i18n = WebGUI::International->new($self->session);
my $language = $i18n->getLanguage($self->session->user->profileField('language'));
my $locale = $language->{languageAbbreviation} || 'en';