mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Another try at fixing the failing test
This commit is contained in:
parent
23187893ba
commit
df69f96a92
@ -76,13 +76,17 @@ def fd_format_timezone(dt, ampm, t, as_utc):
|
||||
def get_ampm_text(which):
|
||||
ans = get_ampm_text[which]
|
||||
if not ans:
|
||||
d = Date()
|
||||
if which is 'am':
|
||||
d.setHours(1, 0, 0, 0)
|
||||
else:
|
||||
d.setHours(13, 0, 0, 0)
|
||||
x = window.Intl.DateTimeFormat('default', { 'hour': 'numeric', 'hour12': True }).format(d)
|
||||
ans = get_ampm_text[which] = x.replace(/\d+/g, '').trim() or which.toUpperCase()
|
||||
try:
|
||||
d = Date()
|
||||
if which is 'am':
|
||||
d.setHours(1, 0, 0, 0)
|
||||
else:
|
||||
d.setHours(13, 0, 0, 0)
|
||||
x = window.Intl.DateTimeFormat('default', { 'hour': 'numeric', 'hour12': True }).format(d)
|
||||
ans = x.replace(/\d+/g, '').trim() or which.toUpperCase()
|
||||
except:
|
||||
ans = which.toUpperCase()
|
||||
get_ampm_text[which] = ans
|
||||
return ans
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user