From 278fe4830fe0beee958957a009d3491574f1535f Mon Sep 17 00:00:00 2001 From: Jon Harper Date: Sun, 1 Jun 2014 15:48:06 +0200 Subject: [PATCH] calendar.format: allow space or tabs in rfc3339 --- basis/calendar/format/format-tests.factor | 22 ++++++++++++++++++++++ basis/calendar/format/format.factor | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/basis/calendar/format/format-tests.factor b/basis/calendar/format/format-tests.factor index a4d20492ba..c0768629f0 100644 --- a/basis/calendar/format/format-tests.factor +++ b/basis/calendar/format/format-tests.factor @@ -94,3 +94,25 @@ IN: calendar.format.tests { second 24 } } ] [ "2013-04-23T13:50:24" rfc3339>timestamp ] unit-test + +[ + T{ timestamp + { year 2001 } + { month 12 } + { day 15 } + { hour 02 } + { minute 59 } + { second 43+1/10 } + } +] [ "2001-12-15 02:59:43.1Z" rfc3339>timestamp ] unit-test + +[ + T{ timestamp + { year 2001 } + { month 12 } + { day 15 } + { hour 02 } + { minute 59 } + { second 43+1/10 } + } +] [ "2001-12-15 02:59:43.1Z" rfc3339>timestamp ] unit-test diff --git a/basis/calendar/format/format.factor b/basis/calendar/format/format.factor index 206b1422bb..8d8250e5e7 100644 --- a/basis/calendar/format/format.factor +++ b/basis/calendar/format/format.factor @@ -171,7 +171,7 @@ M: timestamp year. ( timestamp -- ) : (rfc3339>timestamp) ( -- timestamp ) read-ymd - "Tt" expect + "Tt \t" expect read-hms read1 { { CHAR: . [ read-rfc3339-seconds ] } [ ] } case read-rfc3339-gmt-offset