]> www.average.org Git - pulsecounter.git/blobdiff - web/index.html
fix time interval selection
[pulsecounter.git] / web / index.html
index 2041d70b022f2a21e8022f4fb4540d0eb4e8346e..51a8da9a035400579efabe26ea7f4cd7c156c57b 100644 (file)
   var xzero = 20, yzero = 20;
   var cold_d = [], hot_d = [];
 
+  function showdate(utime) {
+    var dt = new Date(utime*1000);
+    return dt.toLocaleDateString() + " " + dt.toLocaleTimeString();
+  }
+
   function getcomb(lo, hi) {
     var comb = [], lb = [];
     var d = hi - lo;
       (data.current.hot / 100).toFixed(2);
     tmin = data.range.lo;
     tmax = data.range.hi;
+    dbg.innerHTML = "from " + tmin + " to " + tmax
+                  + "<br>from " + showdate(tmin) + " to " + showdate(tmax);
     /* differetiate() updates hmax */
     hmax = 0;
     cold_d = differentiate(data.cold);
   }
 
   function sendquery(lo, hi) {
-    var url = "query.cgi" + "?lo=" + iso2qu(lo) + "&" + iso2qu(hi);
+    var url = "query.cgi" + "?lo=" + iso2qu(lo) + "&hi=" + iso2qu(hi);
 
     //dbg.innerHTML = url;
     xmlhttp.onreadystatechange = function() {