Fix rendering of short month names incorrect on Chrome

This commit is contained in:
Kovid Goyal 2017-05-11 10:07:15 +05:30
parent 74e9b5de69
commit efbd10a908
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -64,7 +64,7 @@ def fd_format_day(dt, ampm, dy, as_utc):
options = {'weekday': ('short' if dy.length is 3 else 'long')} options = {'weekday': ('short' if dy.length is 3 else 'long')}
if as_utc: if as_utc:
options['timeZone'] = 'UTC' options['timeZone'] = 'UTC'
return dt.toLocaleString(undefined, options) return dt.toLocaleString(window.navigator.language, options)
w = dt.getUTCDay() if as_utc else dt.getDay() w = dt.getUTCDay() if as_utc else dt.getDay()
return lcdata['abday' if dy.length is 3 else 'day'][(w + 1) % 7] return lcdata['abday' if dy.length is 3 else 'day'][(w + 1) % 7]
@ -78,7 +78,7 @@ def fd_format_month(dt, ampm, mo, as_utc):
options = {'month': {1:'numeric', 2:'2-digit', 3:'short', 4:'long'}[mo.length] or 'long'} options = {'month': {1:'numeric', 2:'2-digit', 3:'short', 4:'long'}[mo.length] or 'long'}
if as_utc: if as_utc:
options['timeZone'] = 'UTC' options['timeZone'] = 'UTC'
return dt.toLocaleString(undefined, options) return dt.toLocaleString(window.navigator.language, options)
return lcdata['abmon' if mo.length is 3 else 'mon'][m] return lcdata['abmon' if mo.length is 3 else 'mon'][m]
def fd_format_year(dt, ampm, yr, as_utc): def fd_format_year(dt, ampm, yr, as_utc):