Created
July 9, 2009 17:26
-
-
Save chrishyle/143820 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SC.DateTime additions: | |
// added to parse method -- | |
case 'Z': | |
var modifier = scanner.scan(1); | |
if(modifier == 'Z'){ | |
opts.timeZoneOffset = 0; | |
} else { | |
var timeZoneHours = scanner.scanInt(2); | |
if(scanner.scan(1) !== ':'){ | |
scanner.scan(-1); | |
} | |
var timeZoneMinutes = scanner.scanInt(2); | |
var timeZoneSecondsOffset = (timeZoneHours*3600)+(timeZoneMinutes*60); | |
var offset = eval(0 + modifier + timeZoneSecondsOffset); | |
opts.timeZoneOffset = offset; | |
} | |
break; | |
// added to the first switch statement in _get -- | |
case 'utc': return d.utcFormat(); | |
//convience method for output-- | |
toISO8601: function(){ | |
var fmt = '%Y-%m-%dT%H:%M:%S%Z'; | |
return this.constructor._toFormattedString(fmt, this._ms); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment