Skip to content

Commit 40b9e5c

Browse files
committed
FIX: TO-DATA allow string date representation with day represented in one char only too
1 parent 1313331 commit 40b9e5c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/mezz/mezz-date.r

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ to-date: wrap [
6161
any [string? value binary? value]
6262
parse value [
6363
5 skip
64-
copy day: 2 digit space
65-
copy month: 3 alpha space
66-
copy year: 4 digit space
64+
copy day: 1 2 digit space
65+
copy month: 3 alpha space
66+
copy year: 1 4 digit space
6767
copy time: to space space
6868
copy zone: to end
6969
]

src/tests/units/date-test.r3

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ Rebol [
124124
--assert 28-Mar-2019/0:00 = to-date "Thu, 28 Mar 2019 00:00:00 +0000"
125125
--assert 28-Mar-2019/0:00 = to-date to-binary "Thu, 28 Mar 2019 00:00:00 +0000"
126126
--assert 4-Apr-2019/19:41:46 = to-date "Thu, 04 Apr 2019 19:41:46 GMT"
127+
--assert 1-Apr-2019/21:50:04 = to-date "Mon, 1 Apr 2019 21:50:04 GMT"
127128

128129

129130
===end-group===

0 commit comments

Comments
 (0)