Skip to content

Commit

Permalink
Fix 2D view Santa display on 24th december
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Dec 23, 2016
1 parent a308788 commit b2a8af9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions js/map.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -1189,10 +1189,10 @@ function getLiveData(click)
//then load it again every 30 seconds
reloadPage = setInterval(
function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
var currentdate = new Date(Date.UTC());
var currentdate = new Date();
var currentyear = new Date().getFullYear();
var begindate = new Date(Date.UTC(currentyear,12,24,2,0,0,0));
var enddate = new Date(Date.UTC(currentyear,12,25,2,0,0,0));
var begindate = new Date(Date.UTC(currentyear,11,23,2,0,0,0));
var enddate = new Date(Date.UTC(currentyear,11,24,2,0,0,0));
if (currentdate.getTime() > begindate.getTime() && currentdate.getTime() < enddate.getTime()) {
update_santaLayer(false);
}
Expand Down Expand Up @@ -1388,8 +1388,8 @@ function update_polarLayer() {

});

function update_santaLayer(now) {
if (now) var url = "<?php print $globalURL; ?>/live-santa-geojson.php?now";
function update_santaLayer(nows) {
if (nows) var url = "<?php print $globalURL; ?>/live-santa-geojson.php?now";
else var url = "<?php print $globalURL; ?>/live-santa-geojson.php";
var santageoJSON = new L.GeoJSON.AJAX(url,{
onEachFeature: function(feature,layer) {
Expand All @@ -1408,6 +1408,8 @@ function update_santaLayer(now) {
};
var santaplayback = new L.Playback(map,feature,null,playbackOptions);
santaplayback.start();
var now = new Date();
if (nows == false) santaplayback.setCursor(now.getTime());
}
});
};
Expand Down

0 comments on commit b2a8af9

Please sign in to comment.