From a6315d55fb647ed5c7027433dd7f34bb7c867916 Mon Sep 17 00:00:00 2001 From: Ron de Bruijn Date: Thu, 17 Nov 2011 17:14:44 +0100 Subject: Add read instance for time on the client --- lib/js/urweb.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/js') diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 1cfbf0ca..fab15f35 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -136,6 +136,11 @@ function addSeconds(tm, n) { return tm + n * 1000000; } +function stringToTime(string){ + return Date.parse(string) // returns milliseconds and we need microseconds + * 1000; +} + // Error handling @@ -500,7 +505,7 @@ function normalizeTable(table) { var tbody = document.createElement("tbody"); for (script = table.firstChild; script; script = next) { next = script.nextSibling; - + tbody.insertBefore(script, tbody.firstChild); } table.appendChild(tbody); @@ -1353,7 +1358,7 @@ function exec1(env, stack, e) { { var savedStack = stack.next, savedEnv = env; e = {c: "c", v: function(v) { return exec1(savedEnv, savedStack, {c: "c", v: v}); } };} usedK = true; - break; + break; default: whine("Unknown Ur expression kind " + e.c); } @@ -1415,5 +1420,5 @@ function fresh() { return (--nextId).toString(); } -// App-specific code +// App-specific code -- cgit v1.2.3