]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Docs for asp.net style json dates #133 #119
authorTim Wood <washwithcare@gmail.com>
Fri, 3 Feb 2012 18:25:16 +0000 (10:25 -0800)
committerTim Wood <washwithcare@gmail.com>
Fri, 3 Feb 2012 18:25:16 +0000 (10:25 -0800)
sitesrc/docs.jade

index 18c917a83fda363baa5fc22607c0e0dde15ffbe1..4d716aef0204632f04869a1f2a17832a7dafacf9 100644 (file)
@@ -43,6 +43,8 @@ block content
           a(href="#/parsing/now") Now
         li
           a(href="#/parsing/array") Javascript Array
+        li
+          a(href="#/parsing/asp-net") ASP.NET json dates
         li
           a(href="#/parsing/clone") Cloning
       h2
@@ -356,6 +358,17 @@ block content
         | var day = moment(Date.UTC.apply({}, array));
 
 
+      a(name="/parsing/asp-net")
+      h3
+        span ASP.NET style json dates
+      p ASP.NET returns dates in json in the following formats. 
+        code /Date(1198908717056)/
+        |  or 
+        code /Date(1198908717056-0700)/
+      p If a string that matches this format is passed in, it will be parsed correctly.
+      pre moment("/Date(1198908717056-0700)/").valueOf(); // 1198908717056
+
+
       a(name="/parsing/clone")
       h3
         span Cloning