Skip to content

Commit

Permalink
gargoyle: Fix DST offset issues on BW Distribution page
Browse files Browse the repository at this point in the history
(cherry picked from commit c09f15b)
  • Loading branch information
lantis1008 committed Nov 15, 2020
1 parent 399dbe9 commit 14b519a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions package/gargoyle/files/www/js/bdist.js
Expand Up @@ -147,6 +147,13 @@ function doUpdate()
var nextDate = new Date();
nextDate.setTime(latestTime*1000);
nextDate.setUTCMinutes( nextDate.getUTCMinutes()+tzMinutes );
if((isNaN(parseInt(uploadName))) && (uploadName.match(/month/) || uploadName.match(/day/)))
{
// When interval is month or day, the transition is always at beginning of day/month, so adding just a few hours will never change the day or month
// However, when an hour gets subtracted for DST, there are problems.
// So, always add three hours, so when DST shifts an hour back in November date doesn't get pushed back to previous month and wrong month is displayed
nextDate = new Date( nextDate.getTime() + (3*60*60*1000))
}
var nextIntervalStart = nextDate.valueOf()/1000;

timeFrameIntervalData = [];
Expand Down

0 comments on commit 14b519a

Please sign in to comment.