mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
E-book viewer: Fix clock being displayed in 24 hr format on some systems even though system locale is set to use 12 hr format.
This commit is contained in:
parent
b657953478
commit
6daa33600d
@ -40,7 +40,7 @@ def fmt_date_pat():
|
||||
def fd_format_hour(dt, ampm, hr, as_utc):
|
||||
h = dt.getUTCHours() if as_utc else dt.getHours()
|
||||
if ampm:
|
||||
h = h % 12
|
||||
h %= 12
|
||||
return h.toString() if hr.length is 1 else str.format('{:02d}', h)
|
||||
|
||||
|
||||
@ -128,7 +128,7 @@ fd_function_index = {
|
||||
def am_pm_pat():
|
||||
ans = am_pm_pat.ans
|
||||
if not ans?:
|
||||
ans = am_pm_pat.ans = /(ap)|(a)/
|
||||
ans = am_pm_pat.ans = /(ap)|(a)|(AP)|(A)/
|
||||
return ans
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user