Permalink
Browse files

allow the date plugin to accept dates with the ISO8601 "T" separator,

like 2001-09-30T12:31:31
  • Loading branch information...
1 parent 45061fb commit acc7a99e0c2f3520070e822b19b2d34dfed2aabf @kgoess committed Jun 27, 2012
Showing with 8 additions and 1 deletion.
  1. +1 −1 lib/Template/Plugin/Date.pm
  2. +7 −0 t/date.t
@@ -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
@@ -261,3 +261,10 @@ not testing
-%]
-- expect --
12:59
+
+-- test --
+[% USE date;
+ date.format('2001/09/30T12:59:00', '%H:%M')
+-%]
+-- expect --
+12:59

0 comments on commit acc7a99

Please sign in to comment.