From e3f1b7c33ef14bece02bd07b344078f5f39dce82 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 27 Dec 2010 13:44:52 +0100 Subject: [PATCH] L: date_tag muss im render modus jsc_dateformat selbst generieren. --- SL/Template/Plugin/L.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 { -- 2.20.1