Created
November 14, 2011 20:56
-
-
Save orhanveli/1365135 to your computer and use it in GitHub Desktop.
Formatting ASP.NET [Webmethods] seriliazed DateTime objects on javascript side
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
(function ($) { | |
$.dateNet = function (date) { | |
if (date === null || date === undefined) return null; | |
if (/\/Date\([0-9\+]*\)\//.test(date)) | |
return eval('new ' + date.split('/')[1]); | |
return '/Date(' + date.getTime() + ')/'; | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment