Fixes time on modular computers (#10705)

This commit is contained in:
Karolis
2020-12-03 16:20:24 +02:00
committed by GitHub
parent 223689df3c
commit 1a7974bffb
2 changed files with 5 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
author: Karolis2011
delete-after: True
changes:
- bugfix: "Computer clock now should show correct time."

View File

@@ -36,7 +36,7 @@ const HOUR = 36000
const MINUTE = 600
export function worldtime2text(time, timeshift = true) {
const offset = timeshift ? Store.state.roundstart_hour + 2 : 0
const offset = timeshift ? Store.state.roundstart_hour : 0
const hour = Math.floor((time / HOUR + offset) % 24)
const minute = Math.floor(time % HOUR / MINUTE)
return `${('0' + hour).slice(-2)}:${('0' + minute).slice(-2)}`