]> gitweb.factorcode.org Git - factor.git/commitdiff
calendar.format: allow space or tabs in rfc3339
authorJon Harper <jon.harper87@gmail.com>
Sun, 1 Jun 2014 13:48:06 +0000 (15:48 +0200)
committerJon Harper <jon.harper87@gmail.com>
Sun, 1 Jun 2014 14:47:04 +0000 (16:47 +0200)
basis/calendar/format/format-tests.factor
basis/calendar/format/format.factor

index a4d20492ba6d9fa2076b137087c30d9099f7840c..c0768629f0fdce01f6f1e68511c4e7277f0d8cba 100644 (file)
@@ -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
index 206b1422bbf91721d166ed9cc8b91e2f878ca3f2..8d8250e5e77092a8d5f3029e20e90d691ec1cacc 100644 (file)
@@ -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