fix: fix issue with ETA and 12h time format (#1463)

This commit is contained in:
Stefan Dej 2023-07-13 21:40:10 +02:00 committed by GitHub
parent bcbef2f19a
commit 039a446944
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1071,10 +1071,9 @@ export const getters: GetterTree<PrinterState, RootState> = {
const date = new Date(eta)
let am = true
let h: string | number = date.getHours()
if (hours12Format && h > 12) {
am = false
h -= 12
}
if (hours12Format && h > 11) am = false
if (hours12Format && h > 12) h -= 12
if (h < 10) h = '0' + h
const m = date.getMinutes() >= 10 ? date.getMinutes() : '0' + date.getMinutes()