Commit 025d4914 authored by Jérome Perrin's avatar Jérome Perrin

tidrange proto: adjust inputs

* go's `when` does not support "chains" like `2.years.3.months.ago`.
* `10am noon` is ambigious, we don't want so support it.
* date only `2008-12-01` should not retain "current" hour:minute
parent 9124ccda
......@@ -24,6 +24,22 @@ ERROR timespec: 2009-12-01 expected time: 2009-12-01T19:20:00Z parsed time: 2009
```
* go's `when` does not support "chains" like `2.years.3.months.ago`.
* `10am noon` is ambigious, we don't want so support it.
* date only `2008-12-01` should not retain "current" hour:minute
# after adjusting the input
```
python prototype/proto.py
ERROR timespec: last tuesday expected time: 2009-08-25T19:20:00Z parsed time: None
ERROR timespec: 06.05.2009 expected time: 2009-05-06T00:00:00Z parsed time: 2009-06-05T00:00:00Z
go run prototype/proto.go
ERROR timespec: 2.years.3.months.ago expected time: 2007-05-30T19:20:00Z parsed time: 2009-05-30T19:20:00Z
ERROR timespec: July 5th expected time: 2009-07-05T00:00:00Z parsed time: 2009-07-05T19:20:00Z
ERROR timespec: 06.05.2009 expected time: 2009-05-06T00:00:00Z parsed time: 2009-06-05T00:00:00Z
ERROR timespec: Jun 6, 5AM expected time: 2009-06-06T05:00:00Z parsed time: 0000-06-06T00:00:05Z
ERROR timespec: 5AM Jun 6 expected time: 2009-06-06T05:00:00Z parsed time: 0000-06-01T00:00:05Z
```
\ No newline at end of file
......@@ -8,8 +8,6 @@
# XXX for now it's RFC3339 and not hex tid
# git test for approxidate
# XXX for dates without h:m like 2008-12-01 keep same "hour:minute" as now ... do we want this ?
2009-08-30T19:20:00Z now
2009-08-30T19:19:55Z 5 seconds ago
2009-08-30T19:19:55Z 5.seconds.ago
......@@ -18,7 +16,9 @@
2009-08-27T19:20:00Z 3.days.ago
2009-08-09T19:20:00Z 3.weeks.ago
2009-05-30T19:20:00Z 3.months.ago
2007-05-30T19:20:00Z 2.years.3.months.ago
# go's when does not support "chaining" like this
# 2007-05-30T19:20:00Z 2.years.3.months.ago
2009-08-29T06:00:00Z 6am yesterday
2009-08-29T18:00:00Z 6pm yesterday
......@@ -27,19 +27,21 @@
2009-08-30T12:00:00Z noon today
2009-08-29T12:00:00Z noon yesterday
2009-01-05T12:00:00Z January 5th noon pm
2009-08-29T12:00:00Z 10am noon
# this input is "ambiguous"
# 2009-08-29T12:00:00Z 10am noon
2009-08-25T19:20:00Z last tuesday
2009-07-05T19:20:00Z July 5th
2009-06-05T19:20:00Z 06/05/2009
2009-05-06T19:20:00Z 06.05.2009
2009-07-05T00:00:00Z July 5th
2009-06-05T00:00:00Z 06/05/2009
2009-05-06T00:00:00Z 06.05.2009
2009-06-06T05:00:00Z Jun 6, 5AM
2009-06-06T05:00:00Z 5AM Jun 6
2009-06-07T06:00:00Z 6AM, June 7, 2009
2008-12-01T19:20:00Z 2008-12-01
2009-12-01T19:20:00Z 2009-12-01
2008-12-01T00:00:00Z 2008-12-01
2009-12-01T00:00:00Z 2009-12-01
# more
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment