Skip to content

Commit

Permalink
fix: fix issue with ETA and 12h time format
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <meteyou@gmail.com>
  • Loading branch information
meteyou committed Jul 13, 2023
1 parent 3959000 commit 2f27105
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 2f27105

Please sign in to comment.