Skip to content

Commit

Permalink
#298 Fix Point Play bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Jan 4, 2023
1 parent 822fb36 commit 60c03a4
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/essence/Ancillary/TimeUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,9 @@ const TimeUI = {
if (next > end) next = end
if (current === end) next = start

TimeUI.setCurrentTime(next, null, null, true)
if (mode === 'Range') TimeUI.setCurrentTime(next)
if (mode === 'Point') TimeUI.setCurrentTime(next, null, null, true)

TimeUI._remakeTimeSlider(true)
},
toggleTimeNow(force) {
Expand Down Expand Up @@ -660,13 +662,22 @@ const TimeUI = {
TimeUI.timeSlider.$on('stop', (e) => {
let idx = 0
if (TimeUI.modes[TimeUI.modeIndex] === 'Point') idx -= 1

const date = new Date(e.detail.value)
const offsetNowDate = new Date(
date.getTime() + date.getTimezoneOffset() * 60000
)
if (e.detail.activeHandle === idx) {
const date = TimeUI.addOffset(new Date(e.detail.value))
TimeUI.setStartTime(date.toISOString(), false, true)
const parsedNow = TimeUI.startTempus.dates.parseInput(
new Date(offsetNowDate)
)
TimeUI.startTempus.dates.setValue(parsedNow)
}
if (e.detail.activeHandle === idx + 1) {
const date = TimeUI.addOffset(new Date(e.detail.value))
TimeUI._setCurrentTime(true, new Date(e.detail.value))
const parsedNow = TimeUI.endTempus.dates.parseInput(
new Date(offsetNowDate)
)
TimeUI.endTempus.dates.setValue(parsedNow)
}
})

Expand Down

0 comments on commit 60c03a4

Please sign in to comment.