X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Ftr-fixed-date.html;h=731a3caa7aae7b0919f6420d93e827a8fd88e73c;hp=716e5ceb82a7f63c3649c6acc4cdc60837ffbcd4;hb=11bbf29de447fe39e9d7155fe280a0df70fa8c3c;hpb=81978af92ecdaaefeff5156d9ab3b4f99586df1c diff --git a/httemplate/elements/tr-fixed-date.html b/httemplate/elements/tr-fixed-date.html index 716e5ceb8..731a3caa7 100644 --- a/httemplate/elements/tr-fixed-date.html +++ b/httemplate/elements/tr-fixed-date.html @@ -1,13 +1,19 @@ <% include('tr-fixed.html', %opt ) %> <%init> -my %opt = @_; +my %opt; +if ( ref($_[0]) ) { + my $hashref = shift; + %opt = %$hashref; +} else { + %opt = @_; +} my $value = $opt{'curr_value'} || $opt{'value'}; my $conf = new FS::Conf; -my $date_format = $conf->config('date_format') || '%m/%d/%Y'; +my $date_format = $opt{'format'} || $conf->config('date_format') || '%m/%d/%Y'; -$opt{'formatted_value'} = time2str($date_format, $value); +$opt{'formatted_value'} = $value > 0 ? time2str($date_format, $value) : '';