Commit dc045c79 authored by Stephen D's avatar Stephen D
Browse files

Shows timezone

parent 5aafa511
......@@ -31,7 +31,10 @@
<td><button type="button" class="btn btn-danger" ng-click="removePoint($index)">Remove</button></td>
</tr>
</table>
<div style="margin: 6px">Click on the map to add a point</div><BR><BR>
<div style="margin: 6px">
Click on the map to add a point<br>
Time zone: {{getTimezone()}}
</div><BR><BR>
<button type="button" class="btn btn-success" ng-disabled="places.length == 0" ng-click="getPasses()">Calculate Passes</button>
<span class='glyphicon-left glyphicon glyphicon-refresh spinning' ng-show='isGettingPasses'></span>
</center><BR>
......
......@@ -104,6 +104,13 @@ app.controller('satTrack-ctrl', function($scope, NgMap) {
var d = moment.duration(moment(a).diff(moment(b)));
return (d / 60000) + " minutes";
}
$scope.getTimezone = function() {
offset = new Date().getTimezoneOffset();
halfHour = offset % 60;
halfHourStr = halfHour > 9 ? "" + halfHour : "0" + halfHour;
return "GMT" + (offset > 0 ? "-" : "+") + Math.floor(offset / 60) + halfHourStr;
}
});
function flatten(arr) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment