use base qw( Template::Plugin );
use Template::Plugin;
+use List::MoreUtils qw(apply);
use strict;
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';
%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 {