L.date_tag kann jetzt auch mit DateTime objekten umgehen
authorSven Schöling <s.schoeling@linet-services.de>
Wed, 12 Oct 2011 12:33:59 +0000 (14:33 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 12 Oct 2011 12:33:59 +0000 (14:33 +0200)
SL/Template/Plugin/L.pm

index 476b60a..bf0d541 100644 (file)
@@ -4,6 +4,7 @@ use base qw( Template::Plugin );
 use Template::Plugin;
 use List::MoreUtils qw(apply);
 use List::Util qw(max);
+use Scalar::Util qw(blessed);
 
 use strict;
 
@@ -273,7 +274,9 @@ sub date_tag {
 
   $params{cal_align} ||= 'BR';
 
-  $self->input_tag($name, $value,
+  my $str_value = blessed $value ? $value->to_lxoffice : $value;
+
+  $self->input_tag($name, $str_value,
     id     => $name_e,
     size   => 11,
     title  => _H($::myconfig{dateformat}),