diff options
author | ivan <ivan> | 2009-08-07 23:08:03 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-08-07 23:08:03 +0000 |
commit | c183de0b7e942672cafdc1c14a203e389ffd2c43 (patch) | |
tree | 87980978b6bd03281ac09538b0daed460bfb5a33 /httemplate/elements/tr-input-date-field.html | |
parent | 958afb8d05de67e12df258b57bedcf85028b6253 (diff) |
add ability to edit signup dates (turn on cust_main-edit_signupdate config), RT#4644
Diffstat (limited to 'httemplate/elements/tr-input-date-field.html')
-rw-r--r-- | httemplate/elements/tr-input-date-field.html | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/httemplate/elements/tr-input-date-field.html b/httemplate/elements/tr-input-date-field.html index 428221a5c..2a731e1e8 100644 --- a/httemplate/elements/tr-input-date-field.html +++ b/httemplate/elements/tr-input-date-field.html @@ -23,7 +23,17 @@ <%init> -my($name, $value, $label, $format, $usedatetime) = @_; +my($name, $value, $label, $format, $usedatetime); +if ( ref($_[0]) ) { + my $opt = shift; + $name = $opt->{'name'}; + $value = $opt->{'value'}; + $label = $opt->{'label'}; + $format = $opt->{'format'}; + $usedatetime = $opt->{'usedatetime'}; +} else { + ($name, $value, $label, $format, $usedatetime) = @_; +} $format = "%m/%d/%Y" unless $format; $label = $name unless $label; @@ -32,7 +42,7 @@ if ( $value =~ /\S/ ) { if ( $usedatetime ) { my $dt = DateTime->from_epoch(epoch => $value, time_zone => 'floating'); $value = $dt->strftime($format); - } else { + } elsif ( $value =~ /^\d+$/ ) { $value = time2str($format, $value); } } else { |