summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-input-date-field.html
diff options
context:
space:
mode:
authorjeff <jeff>2006-12-15 05:29:48 +0000
committerjeff <jeff>2006-12-15 05:29:48 +0000
commit02b9c53fb85b0a87d959e140dc30ae21cccb0902 (patch)
tree56d1edfd2ee7a2f92fe830b8e55a6db84d214b0f /httemplate/elements/tr-input-date-field.html
parentba1f19e48ec2f2ac293b07a41042de59e744db1e (diff)
move use statements to handler.pl, do not show 1/1/70 for new birthdates, and improve error handling
Diffstat (limited to 'httemplate/elements/tr-input-date-field.html')
-rw-r--r--httemplate/elements/tr-input-date-field.html5
1 files changed, 2 insertions, 3 deletions
diff --git a/httemplate/elements/tr-input-date-field.html b/httemplate/elements/tr-input-date-field.html
index 1624df05c..2320a9552 100644
--- a/httemplate/elements/tr-input-date-field.html
+++ b/httemplate/elements/tr-input-date-field.html
@@ -29,10 +29,9 @@ $format = "%m/%d/%Y" unless $format;
$label = $name unless $label;
if ($usedatetime) {
- eval "use DateTime;";
- die $@ if $@;
my $dt = DateTime->from_epoch(epoch => $value, time_zone => 'floating');
- $value = $dt->strftime($format);
+ $value = $dt->strftime($format)
+ unless $value eq '';
}else{
$value = time2str($format, $value);
}