in my template(via Template Toolkit
), I pass a DateTime object(from DBIx::Class
and DBIx::Class::InflateColumn::DateTime
). I can do obj.year and all other DateTime operations in my template. But the object gets stringified in my custom filter. I am basically calling [% user.last_visited_date | time_ago %]
where time_ago is a custom filter basically looks like this:
sub timeago {
sub { my $datetime_obj = shift; #do more work }
}
here I am expecting a DateTime obj in the custom filter but instead it is stringify..
How do I work around this?