Confirmed. The problem is that Template::Plugin::DateTime::Format::format tries to pass extra arguments to the format_datetime method.
Given the way the code is written, I suspect the intention was to accept an arrayref at 'new' time, and pass its contents to ->format_datetime
The attached patch fixes makes it do that. After the patch is applied, tests pass with latest versions of all dependencies.
diff --git i/lib/Template/Plugin/DateTime/Format.pm w/lib/Template/Plugin/DateTime/Format.pm
index 241ccca..cc0cd64 100644
--- i/lib/Template/Plugin/DateTime/Format.pm
+++ w/lib/Template/Plugin/DateTime/Format.pm
@@ -15,14 +15,14 @@ sub new {
Class::Load::load_class($formatter_class || die 'need class name');
my @new_args = ref $new_args eq 'ARRAY' ? @$new_args : $new_args;
- { no warnings;
+ if ($format_args) {
$format_args = [ $format_args ] unless ref $format_args eq 'ARRAY';
}
bless {
_CONTEXT => $context,
formatter => $formatter_class->new(@new_args),
- format_args => $format_args,
+ format_args => $format_args || [],
}, $class;
}
@@ -30,7 +30,7 @@ sub format {
my ($self, $date) = @_;
my $fmt = $self->{formatter};
- my @args = $self->{format_args};
+ my @args = @{$self->{format_args}};
return $fmt->format_datetime($date, @args);
}