Merge pull request #18 from danstowell/jsrouting-durationcalc
Fix hours:minutes duration display for routing
This commit is contained in:
commit
73eb8a5336
1 changed files with 3 additions and 1 deletions
|
@ -235,7 +235,9 @@ OSM.Routing=function(map,name,jqSearch) {
|
||||||
else { return Math.round(m / 1000) + "km"; }
|
else { return Math.round(m / 1000) + "km"; }
|
||||||
};
|
};
|
||||||
r.formatTime=function(s) {
|
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;
|
return h+":"+(m<10 ? '0' : '')+m;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue