Поправлена нижняя граница прокрутки архива

This commit is contained in:
goodmice 2021-11-17 15:01:36 +05:00
parent 70a7812e81
commit 0de213c3dc

View File

@ -74,7 +74,7 @@ export default function Archive({idWell}) {
const offset = e.deltaY * chartInterval * WHEEL_SENSITIVITY
const nextStartDate = +prevStartDate + offset
const firstPossibleDate = Math.max(loaded.start, dateLimit.from)
const lastPossibleDate = Math.min(loaded.end, Date.now()) - chartInterval
const lastPossibleDate = Math.min(dateLimit.to, (loaded.end ?? Date.now())) - chartInterval
return new Date(Math.max(firstPossibleDate, Math.min(nextStartDate, lastPossibleDate)))
})
}