mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fixed timezone calculation in initWithString.
This commit is contained in:
committed by
Randall Luecke
parent
2f501ad736
commit
e3abd4e407
+2
-2
@@ -110,10 +110,10 @@ var CPDateReferenceDate = new Date(Date.UTC(2001, 1, 1, 0, 0, 0, 0));
|
||||
|
||||
if (!d || d.length != 10)
|
||||
[CPException raise:CPInvalidArgumentException
|
||||
reason:"initWithString: the string must be of YYYY-MM-DD HH:MM:SS ±HHMM format"];
|
||||
reason:"initWithString: the string must be in YYYY-MM-DD HH:MM:SS ±HHMM format"];
|
||||
|
||||
var date = new Date(d[1], d[2] - 1, d[3]),
|
||||
timeZoneOffset = (Number(d[8]) * 60 + Number(d[9])) * (d[7] === '-' ? -1 : 1);
|
||||
timeZoneOffset = (Number(d[8]) * 60 + Number(d[9])) * (d[7] === '-' ? 1 : -1);
|
||||
|
||||
date.setHours(d[4]);
|
||||
date.setMinutes(d[5]);
|
||||
|
||||
Reference in New Issue
Block a user