Making date parsing a bit more lenient.
RFC 3339 doesn't say what timezone to assume for date strings without time. Some servers append "Z" to dates (e.g. "2001-02-03Z") and some clients accept this (e.g. Chrome). The OpenLayers date parser now accepts dates without times and with "Z" at the end.
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
|
||||
function test_Date_parse(t) {
|
||||
|
||||
t.plan(93);
|
||||
t.plan(114);
|
||||
|
||||
var cases = {
|
||||
"2000": {
|
||||
@@ -127,6 +127,18 @@
|
||||
minutes: 51,
|
||||
seconds: 25,
|
||||
milliseconds: 123
|
||||
},
|
||||
"2000Z": { // lenient (Chrome accepts this)
|
||||
year: 2000
|
||||
},
|
||||
"2000-02Z": { // lenient (Chrome accepts this)
|
||||
year: 2000,
|
||||
month: 1
|
||||
},
|
||||
"2000-04-15Z": { // lenient (Chrome accepts this)
|
||||
year: 2000,
|
||||
month: 3,
|
||||
date: 15
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user