Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

debugging dates

Benjamindc3de180d9bc
diff --git a/web/js/animation/wv.anim.ui.js b/web/js/animation/wv.anim.ui.js
index 0ecbb13ca..ca8cd4779 100644
--- a/web/js/animation/wv.anim.ui.js
+++ b/web/js/animation/wv.anim.ui.js
@@ -206,7 +206,11 @@ wv.anim.ui = wv.anim.ui || function(models, ui) {
self.setNewDate = function(date, newDate) {
var interval = self.getInterval();
var day = date.getDate();
+ var newDateDay = newDate.getDate();
var month = date.getMonth();
+ if(day > newDateDay) {
+ newDate = self.nextDate(newDate);
+ }
if(interval === 'month') {
return new Date(newDate.setUTCDate(day + 1));
} else if(interval === 'year') {