changeset 1518:883347f5c3c2

Client-side 'addSeconds'
author Adam Chlipala <adam@chlipala.net>
date Sun, 24 Jul 2011 14:49:40 -0400
parents 27b8c0a460cf
children ada582d07ae1
files lib/js/urweb.js src/settings.sml
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Sun Jul 24 10:51:48 2011 -0400
+++ b/lib/js/urweb.js	Sun Jul 24 14:49:40 2011 -0400
@@ -113,6 +113,10 @@
     return Math.round(tm / 1000000);
 }
 
+function addSeconds(tm, n) {
+    return tm + n * 1000000;
+}
+
 
 // Error handling
 
--- a/src/settings.sml	Sun Jul 24 10:51:48 2011 -0400
+++ b/src/settings.sml	Sun Jul 24 14:49:40 2011 -0400
@@ -254,6 +254,7 @@
                           ("timeToString", "showTime"),
                           ("htmlifyTime", "showTime"),
                           ("toSeconds", "toSeconds"),
+                          ("addSeconds", "addSeconds"),
                           ("diffInSeconds", "diffInSeconds")]
 val jsFuncs = ref jsFuncsBase
 fun setJsFuncs ls = jsFuncs := foldl (fn ((k, v), m) => M.insert (m, k, v)) jsFuncsBase ls