From cb4a3ebb99d414db9d1299de06c0cb98e5238109 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Sun, 3 Apr 2011 22:41:03 -0700 Subject: [PATCH] small modification to tauren's parseISO8601 changes --- .gitignore | 6 ------ src/date_util.js | 9 +++------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index ce67aad..6686c4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,3 @@ build/fullcalendar build/fullcalendar-* dist -.project -.settings -.classpath -target -hs_err* -.tmp_* diff --git a/src/date_util.js b/src/date_util.js index cfdb03b..6149627 100644 --- a/src/date_util.js +++ b/src/date_util.js @@ -162,11 +162,7 @@ function parseDate(s, ignoreTimezone) { // ignoreTimezone defaults to true function parseISO8601(s, ignoreTimezone) { // ignoreTimezone defaults to false // derived from http://delete.me.uk/2005/03/iso8601.html // TODO: for a know glitch/feature, read tests/issue_206_parseDate_dst.html - - // TNM 2011-02-01: Updated regex to support +0000 or +00 timezones in addition to +00:00 - // See: http://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC - var m = s.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})((:?)([0-9]{2}))?))?)?)?)?$/); - + var m = s.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/); if (!m) { return null; } @@ -207,7 +203,8 @@ function parseISO8601(s, ignoreTimezone) { // ignoreTimezone defaults to false m[10] || 0, m[12] ? Number("0." + m[12]) * 1000 : 0 ); - var offset = Number(m[16]) * 60 + (m[19] ? Number(m[19]) : 0); + console.log(m[18]); + var offset = Number(m[16]) * 60 + (m[18] ? Number(m[18]) : 0); offset *= m[15] == '-' ? 1 : -1; date = new Date(+date + (offset * 60 * 1000)); }