Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

update right arrow disabled logic (#4738)

Ryan Weilera58c5580881b
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index 3b12d403f..c014004fb 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -106,11 +106,11 @@ const checkRightArrowDisabled = (
timelineEndDateLimit,
) => {
const nextIncMoment = moment.utc(date).add(delta, timeScaleChangeUnit);
- const nextIncrementDate = new Date(nextIncMoment.seconds(0).format());
- const nextIncrementDateTime = nextIncrementDate.getTime();
- const maxPlusDeltaDateTime = new Date(timelineEndDateLimit).getTime();
- return nextIncrementDateTime > maxPlusDeltaDateTime;
+ const startOfDayNextIncrement = nextIncMoment.startOf('day').valueOf();
+ const startOfDayLimit = moment.utc(timelineEndDateLimit).startOf('day').valueOf();
+
+ return startOfDayNextIncrement > startOfDayLimit;
};
const checkNowButtonDisabled = (