Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #10 from kgoess/master

Plugin::Date to accept "T" in ISO8601 dates
  • Loading branch information...
commit ead6360ac5c27805b1f517ee4d172f9cfb252aa6 2 parents 4cc7df3 + acc7a99
@abw authored
Showing with 8 additions and 1 deletion.
  1. +1 −1  lib/Template/Plugin/Date.pm
  2. +7 −0 t/date.t
View
2  lib/Template/Plugin/Date.pm
@@ -98,7 +98,7 @@ sub format {
# otherwise, we try to parse it as either a 'Y:M:D H:M:S' or a
# 'H:M:S D:M:Y' string
- my @parts = (split(/(?:\/| |:|-)/, $time));
+ my @parts = (split(/\D/, $time));
if (@parts >= 6) {
if (length($parts[0]) == 4) {
View
7 t/date.t
@@ -261,3 +261,10 @@ not testing
-%]
-- expect --
12:59
+
+-- test --
+[% USE date;
+ date.format('2001/09/30T12:59:00', '%H:%M')
+-%]
+-- expect --
+12:59
Please sign in to comment.
Something went wrong with that request. Please try again.