Enhances Date.parse to support ES5 ISO-8601 strings in all environments.
JavaScript
230
9 commits
updated Jul 8, 2014
ECMAScript revision 5 adds native support for simplified ISO 8601 dates in the
Date.parse method, but some browsers currently on the market (Safari 5-, IE 8-, Firefox 3.6-) do not support it. This
is a simple shim for Date.parse that adds support for parsing ES5 simplified ISO 8601 strings to all browsers.
If you are attempting to parse date strings coming from non-ES5-conformant backends, please consider using the non-conformant edition.
new Date(dateString) form will not be fixed by this shim.By default, the unit tests are configured only to test the JavaScript fallback portion of the script, which means your browser’s native Date.parse implementation will not be used. Add “?useNativeDateParse” to the URL to run unit tests that will use the browser’s native implementation (for browser compliance testing purposes).
Note: You must checkout using git clone --recursive in order for unit tests to function.
© 2011 Colin Snover. MIT Licensed.
9 commits
JavaScript
100.0%
Enhances Date.parse to support ES5 ISO-8601 strings in all environments.
JavaScript
230
9 commits
updated Jul 8, 2014
ECMAScript revision 5 adds native support for simplified ISO 8601 dates in the
Date.parse method, but some browsers currently on the market (Safari 5-, IE 8-, Firefox 3.6-) do not support it. This
is a simple shim for Date.parse that adds support for parsing ES5 simplified ISO 8601 strings to all browsers.
If you are attempting to parse date strings coming from non-ES5-conformant backends, please consider using the non-conformant edition.
new Date(dateString) form will not be fixed by this shim.By default, the unit tests are configured only to test the JavaScript fallback portion of the script, which means your browser’s native Date.parse implementation will not be used. Add “?useNativeDateParse” to the URL to run unit tests that will use the browser’s native implementation (for browser compliance testing purposes).
Note: You must checkout using git clone --recursive in order for unit tests to function.
© 2011 Colin Snover. MIT Licensed.
9 commits
JavaScript
100.0%