Created
March 22, 2012 17:41
-
-
Save brianium/2160704 to your computer and use it in GitHub Desktop.
using WCF serialized dates in JavaScript
This file contains hidden or 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
String.prototype.DateWCF = function () { | |
var d = new Date(parseInt(this.substr(6))); | |
return (d.getUTCMonth() + 1) + '/' + d.getUTCDate(); | |
}; | |
//usage | |
var option = //some shipping option object returned from a RESTful WCF service | |
option.DeliveryEnd.DateWCF() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This example returns just the month and day, but you could certainly expand on that for your needs