Skip to content

Instantly share code, notes, and snippets.

@brianium
Created March 22, 2012 17:41
Show Gist options
  • Save brianium/2160704 to your computer and use it in GitHub Desktop.
Save brianium/2160704 to your computer and use it in GitHub Desktop.
using WCF serialized dates in JavaScript
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()
@brianium
Copy link
Author

This example returns just the month and day, but you could certainly expand on that for your needs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment