diff lib/js/urweb.js @ 1632:4682b312e9d5

Fix client-side [int] parsing and extend server-side [time] parsing to support a format that also works portably in JavaScript
author Adam Chlipala <adam@chlipala.net>
date Sun, 04 Dec 2011 16:32:06 -0500
parents 747f94ac5fc2
children b0720700c36e
line wrap: on
line diff
--- a/lib/js/urweb.js	Sun Dec 04 15:18:41 2011 -0500
+++ b/lib/js/urweb.js	Sun Dec 04 16:32:06 2011 -0500
@@ -143,7 +143,7 @@
 function stringToTime_error(string) {
     var t = Date.parse(string);
     if (isNaN(t))
-        onFail("Invalid date string: " + string);
+        er("Invalid date string: " + string);
     else
         return t * 1000;
 }
@@ -962,7 +962,7 @@
 
 function trimZeroes(s) {
     for (var i = 0; i < s.length; ++i)
-        if (s[i] != '0') {
+        if (s.charAt(i) != '0') {
             if (i > 0)
                 return s.substring(i);
             else