Skip to content

Commit 675377b

Browse files
authored
Fix #137481
Find the length of the longest day name in the current locale. Use that length, rather than a constant "9", to decide if the names should be abbreviated.
1 parent f0a3c6e commit 675377b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/calendar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def formatweekday(self, day, width):
370370
"""
371371
Returns a formatted week day name.
372372
"""
373-
if width >= 9:
373+
if width >= max(map(len, day_name)):
374374
names = day_name
375375
else:
376376
names = day_abbr

0 commit comments

Comments
 (0)