Skip to content

Commit

Permalink
fix: fix issue with ETA and 12h time format (#1463)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Jul 13, 2023
1 parent bcbef2f commit 039a446
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/store/printer/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 039a446

Please sign in to comment.