Created
July 24, 2018 11:33
-
-
Save gustavomdsantos/0a479f6732a12527ea3d022922c167df to your computer and use it in GitHub Desktop.
Conversor de data (JavaScript Date) para string de data compatível com o formato .NET DataContractJsonSerializer (MSJSON).
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
Date::toMSJSON = -> | |
"/Date(" + @getTime() + ")/" | |
String::convertMSJSONtoDate = -> | |
if @startsWith '/Date(' | |
timestamp = @substr 6, 13 | |
new Date(parseInt timestamp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment