diff iso8601.js @ 29:e007a6364bf0

Fix an error when loading file/directory.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 01 Nov 2010 09:18:54 +0100
parents 7cfcd7d5796c
children 5395a501c991
line wrap: on
line diff
--- a/iso8601.js
+++ b/iso8601.js
@@ -18,11 +18,11 @@
  */
 
 Date.prototype.setFromISO8601 = function(iso){
-	var format = /(\d\{4\})(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)Z/;
+	var format = /(\d{4})(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)Z/;
 	var m = iso.match(format);
 
 	this.setUTCDate(1);
-	this.setUTCFullYear(parseInt(m[1],10));
+	this.setUTCFullYear(parseInt(m[1]));
 	this.setUTCMonth(parseInt(m[3],10) - 1);
 	this.setUTCDate(parseInt(m[5],10));
 	this.setUTCHours(parseInt(m[7],10));