Merge branch 'master' of git@github.com:plainblack/webgui

This commit is contained in:
daviddelikat 2009-12-02 19:07:12 -06:00
commit 37676cb654
8 changed files with 157 additions and 16 deletions

View file

@ -37,12 +37,13 @@ time is used instead.
#-------------------------------------------------------------------
sub process {
my $session = shift;
my (@param, $temp, $time);
@param = @_;
$time = $param[1] ||time();
$temp =$session->datetime->epochToHuman($time,$param[0]);
return $temp;
my $session = shift;
my $time = $_[1];
if (! defined $time) {
$time = time();
}
my $temp = $session->datetime->epochToHuman($time, $_[0]);
return $temp;
}

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';