|
|
@ -89,6 +89,16 @@ function onTrainData(data, fetchDate) { |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|
// Implement date switcher
|
|
|
|
// Implement date switcher
|
|
|
|
yesterday = !yesterday |
|
|
|
yesterday = !yesterday |
|
|
|
|
|
|
|
if (!yesterday) { |
|
|
|
|
|
|
|
history.back() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
const yesterdayUrl = new URL(location.href) |
|
|
|
|
|
|
|
const newDate = new Date(date.getTime()) |
|
|
|
|
|
|
|
newDate.setDate(newDate.getDate() - 1) |
|
|
|
|
|
|
|
yesterdayUrl.searchParams.set('date', newDate.toISOString()) |
|
|
|
|
|
|
|
history.pushState('', '', yesterdayUrl) |
|
|
|
|
|
|
|
} |
|
|
|
refresh() |
|
|
|
refresh() |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
@ -495,7 +505,13 @@ function rsk() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener('popstate', function (e) { |
|
|
|
window.addEventListener('popstate', function (e) { |
|
|
|
|
|
|
|
if (yesterday) { |
|
|
|
|
|
|
|
yesterday = false |
|
|
|
|
|
|
|
trainData = null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
groupIndex = null |
|
|
|
groupIndex = null |
|
|
|
|
|
|
|
} |
|
|
|
if (trainData) { |
|
|
|
if (trainData) { |
|
|
|
onTrainData(trainData) |
|
|
|
onTrainData(trainData) |
|
|
|
} |
|
|
|
} |
|
|
|