Comparing version 2.5.0 to 2.5.1
@@ -20,3 +20,7 @@ var arrayParser = require(__dirname + "/arrayParser.js"); | ||
} | ||
var year = match[1]; | ||
var isBC = /BC$/.test(isoDate); | ||
var _year = parseInt(match[1], 10); | ||
var isFirstCentury = (_year > 0) && (_year < 100); | ||
var year = (isBC ? "-" : "") + match[1]; | ||
var month = parseInt(match[2],10)-1; | ||
@@ -41,2 +45,3 @@ var day = match[3]; | ||
var tzAdjust = 0; | ||
var date; | ||
if(tZone) { | ||
@@ -58,9 +63,14 @@ var type = tZone[1]; | ||
var utcOffset = Date.UTC(year, month, day, hour, min, seconds, mili); | ||
return new Date(utcOffset - (tzAdjust * 60* 1000)); | ||
date = new Date(utcOffset - (tzAdjust * 60* 1000)); | ||
} | ||
//no timezone information | ||
else { | ||
return new Date(year, month, day, hour, min, seconds, mili); | ||
date = new Date(year, month, day, hour, min, seconds, mili); | ||
} | ||
if (isFirstCentury) { | ||
date.setUTCFullYear(year); | ||
} | ||
return date; | ||
}; | ||
@@ -67,0 +77,0 @@ |
{ | ||
"name": "pg.js", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "node-postgres without the bindings", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145560
4824