This commit is contained in:
Kovid Goyal 2024-03-11 20:55:29 +05:30
commit cf0ad84d57
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 11 additions and 0 deletions

View File

@ -575,3 +575,8 @@ allow_template_database_functions_in_composites = False
# for https://whatever URLs. %u is replaced by the URL to be opened. The scheme # for https://whatever URLs. %u is replaced by the URL to be opened. The scheme
# takes a glob pattern allowing a single entry to match multiple URL types. # takes a glob pattern allowing a single entry to match multiple URL types.
openers_by_scheme = {} openers_by_scheme = {}
#: Set the first day of the week for calendar popups
# It must be one of the values Default, Sunday, Monday, Tuesday, Wednesday,
# Thursday, Friday, or Saturday, all in English, spelled exactly as shown.
calendar_start_day_of_week = 'Default'

View File

@ -707,6 +707,12 @@ class DateTimeEdit(QDateTimeEdit):
self.setMinimumDateTime(UNDEFINED_QDATETIME) self.setMinimumDateTime(UNDEFINED_QDATETIME)
self.setCalendarPopup(True) self.setCalendarPopup(True)
self.cw = CalendarWidget(self) self.cw = CalendarWidget(self)
if tweaks['calendar_start_day_of_week'] != 'Default':
try:
dow = Qt.DayOfWeek[tweaks['calendar_start_day_of_week']]
self.cw.setFirstDayOfWeek(dow)
except Exception:
print(f"Bad value for tweak calendar_start_day_of_week: {tweaks['calendar_start_day_of_week']}")
self.cw.setVerticalHeaderFormat(QCalendarWidget.VerticalHeaderFormat.NoVerticalHeader) self.cw.setVerticalHeaderFormat(QCalendarWidget.VerticalHeaderFormat.NoVerticalHeader)
self.setCalendarWidget(self.cw) self.setCalendarWidget(self.cw)
self.setSpecialValueText(_('Undefined')) self.setSpecialValueText(_('Undefined'))