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):
|
def get_ampm_text(which):
|
||||||
ans = get_ampm_text[which]
|
ans = get_ampm_text[which]
|
||||||
if not ans:
|
if not ans:
|
||||||
d = Date()
|
try:
|
||||||
if which is 'am':
|
d = Date()
|
||||||
d.setHours(1, 0, 0, 0)
|
if which is 'am':
|
||||||
else:
|
d.setHours(1, 0, 0, 0)
|
||||||
d.setHours(13, 0, 0, 0)
|
else:
|
||||||
x = window.Intl.DateTimeFormat('default', { 'hour': 'numeric', 'hour12': True }).format(d)
|
d.setHours(13, 0, 0, 0)
|
||||||
ans = get_ampm_text[which] = x.replace(/\d+/g, '').trim() or which.toUpperCase()
|
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
|
return ans
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user