Skip to content

Commit

Permalink
Shorten.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Nov 11, 2015
1 parent ae1db70 commit 53beaf3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,7 @@ function parseYear(d, string, i) {

function parseZone(d, string, i) {
var n = /^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(string.slice(i, i + 6));
if (n) {
d.Z = n[1] ? 0 // 'Z' for UTC
: n[3] ? -(n[2] + n[3]) // sign differs from getTimezoneOffset!
: -n[2] * 100;
return i + n[0].length;
}
return -1;
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
}

function parseMonthNumber(d, string, i) {
Expand Down

0 comments on commit 53beaf3

Please sign in to comment.