]> git.openstreetmap.org Git - rails.git/commitdiff
Merge pull request #19 from apmon/jsroute2
authorRichard Fairhurst <richard@systemeD.net>
Mon, 31 Mar 2014 16:51:37 +0000 (17:51 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Mon, 31 Mar 2014 16:51:37 +0000 (17:51 +0100)
Minor fixes to the I18n code of routing

app/assets/javascripts/routing.js.erb

index 3f38beef4382a6484c273adad28e3830a0007894..5ff0656c81c99f1767c700888391a0b133a5e1e9 100644 (file)
@@ -235,7 +235,9 @@ OSM.Routing=function(map,name,jqSearch) {
         else                { return Math.round(m / 1000)  + "km"; }
     };
     r.formatTime=function(s) {
-        var d=new Date(s*1000); var h=d.getHours(); var m=d.getMinutes();
+        var m=Math.round(s/60);
+        var h=Math.floor(m/60);
+        m -= h*60;
         return h+":"+(m<10 ? '0' : '')+m;
     };