Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Plugin::Date to accept "T" in ISO8601 dates #10

Merged
merged 1 commit into from

2 participants

@kgoess

t would nice if Plugin::Date could accept dates with a "T" as the separator like ISO8601 dates:

2012-09-30T12:59:00

http://en.wikipedia.org/wiki/I SO_8601

I opened an RT bug on CPAN with this same request.

https://rt.cpan.org/Ticket/Display.html?id=78065

Thanks!

@abw abw merged commit ead6360 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 27, 2012
  1. @kgoess
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.