-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
History Best Days graph sending to the wrong date #2402
Labels
Comments
It looks like we need to update two functions in history.blade.php to address this: function selectHandlerBestDays(e) {
if (chartBestDays.getSelection().length >= 1) {
var dateAbbr = dataBestDays.getFormattedValue(chartBestDays.getSelection()[0].row, 0);
var dateParsed = Date.parse(dateAbbr) / 1000;
window.location = '/historyexamine.php?d=' + dateParsed + '&u=<?= $userPage ?>';
}
} function selectHandlerScoreProgress(e) {
if (chartScoreProgress.getSelection().length >= 1) {
var dateFormatted = dataTotalScore.getFormattedValue(chartScoreProgress.getSelection()[0].row, 0);
var d = new Date(Date.parse(dateFormatted));
var dAdj = new Date(d.getTime() + 60000 * 60 * 12); // Adjusted by 60000 (min) times 60 (hour) times 12 (middle of day)
var nUnix = parseInt(dAdj.getTime() / 1000);
window.location = '/historyexamine.php?d=' + nUnix + '&u=' + <?php echo "'$userPage'"; ?>;
}
} I can take a look once I finished getting my local environment up and running. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I'm guessing this happens when we live east to the UTC line.
On the history page, if I click on one of the bars in the "Best Days" graph, I get sent to the day before the one I clicked.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Arriving on the page for the day we clicked
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Checked on:
Additional context
All the other ways to get to a date on the page work (for me).
The timestamp used in the URL correspond to a different hour of the day depending on the widget we use:
I'm guessing using the same conversion for the graphs as for the links would give a more consistent behavior?
The text was updated successfully, but these errors were encountered: