diff --git a/examples/feature-animation.js b/examples/feature-animation.js index 7d469cc1e0..a9aa58ed69 100644 --- a/examples/feature-animation.js +++ b/examples/feature-animation.js @@ -43,7 +43,7 @@ function addRandomFeature() { const duration = 3000; function flash(feature) { - const start = new Date().getTime(); + const start = Date.now(); const flashGeom = feature.getGeometry().clone(); const listenerKey = tileLayer.on('postrender', animate); diff --git a/examples/feature-move-animation.js b/examples/feature-move-animation.js index 95573e7a92..c5b6166cc1 100644 --- a/examples/feature-move-animation.js +++ b/examples/feature-move-animation.js @@ -142,7 +142,7 @@ fetch('data/polyline/route.json').then(function (response) { stopAnimation(false); } else { animating = true; - startTime = new Date().getTime(); + startTime = Date.now(); speed = speedInput.value; startButton.textContent = 'Cancel Animation'; // hide geoMarker diff --git a/examples/flight-animation.js b/examples/flight-animation.js index 8948b4a438..8c13b907b2 100644 --- a/examples/flight-animation.js +++ b/examples/flight-animation.js @@ -120,7 +120,7 @@ function animateFlights(event) { function addLater(feature, timeout) { window.setTimeout(function () { - feature.set('start', new Date().getTime()); + feature.set('start', Date.now()); flightsSource.addFeature(feature); }, timeout); } diff --git a/examples/wms-time.js b/examples/wms-time.js index 356634a31a..a2c7419f32 100644 --- a/examples/wms-time.js +++ b/examples/wms-time.js @@ -46,7 +46,7 @@ function updateInfo() { function setTime() { startDate.setMinutes(startDate.getMinutes() + 15); - if (startDate > new Date()) { + if (startDate > Date.now()) { startDate = threeHoursAgo(); } layers[1].getSource().updateParams({'TIME': startDate.toISOString()});