Skip to content

Commit 0fca2d2

Browse files
committed
fixed daylight saving calculation bug
1 parent acbbc8c commit 0fca2d2

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -462,20 +462,15 @@ window.onload = function () {
462462
}, 60000);
463463

464464
function updateTime() {
465-
let today = new Date();
465+
var today = new Date();
466+
today.setHours(today.getHours() + options.ui_clock_dayLightSaving);
466467
year = today.getFullYear();
467468
month = today.getMonth();
468469
date = today.getDate();
469470
day = today.getDay();
470471
hour = today.getHours();
471472
minute = today.getMinutes();
472473

473-
hour += options.ui_clock_dayLightSaving;
474-
if (hour < 0)
475-
hour = 23;
476-
if (hour > 23)
477-
hour = 0;
478-
479474
if (!options.ui_clock_24HourFormat && hour > 12) {
480475
hour = hour % 12;
481476
if (hour == 0)

0 commit comments

Comments
 (0)