From: Sven Schöling Date: Mon, 27 Dec 2010 12:44:52 +0000 (+0100) Subject: L: date_tag muss im render modus jsc_dateformat selbst generieren. X-Git-Tag: release-2.6.2beta1~64^2~33 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e3f1b7c33ef14bece02bd07b344078f5f39dce82;p=kivitendo-erp.git L: date_tag muss im render modus jsc_dateformat selbst generieren. --- diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 19218dbb7..d61822f43 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -2,6 +2,7 @@ package SL::Template::Plugin::L; use base qw( Template::Plugin ); use Template::Plugin; +use List::MoreUtils qw(apply); use strict; @@ -193,6 +194,11 @@ sub date_tag { my %params = _hashify(@slurp); my $name_e = _H($name); my $seq = _tag_id(); + my $datefmt = apply { + s/d+/\%d/gi; + s/m+/\%m/gi; + s/y+/\%Y/gi; + } $::myconfig{"dateformat"}; $params{cal_align} ||= 'BR'; @@ -210,7 +216,7 @@ sub date_tag { %params, ) . $self->javascript( - "Calendar.setup({ inputField: '$name_e', ifFormat: '$::myconfig{jsc_dateformat}', align: '$params{cal_align}', button: 'trigger$seq' });" + "Calendar.setup({ inputField: '$name_e', ifFormat: '$datefmt', align: '$params{cal_align}', button: 'trigger$seq' });" ) : ''); sub javascript_tag {