Always return firstweekday % 7 instead of complaining
on setting.
This commit is contained in:
parent
aba10cf153
commit
72d84af401
|
@ -131,11 +131,9 @@ class Calendar(object):
|
||||||
self.firstweekday = firstweekday # 0 = Monday, 6 = Sunday
|
self.firstweekday = firstweekday # 0 = Monday, 6 = Sunday
|
||||||
|
|
||||||
def getfirstweekday(self):
|
def getfirstweekday(self):
|
||||||
return self._firstweekday
|
return self._firstweekday % 7
|
||||||
|
|
||||||
def setfirstweekday(self, firstweekday):
|
def setfirstweekday(self, firstweekday):
|
||||||
if not MONDAY <= firstweekday <= SUNDAY:
|
|
||||||
raise IllegalWeekdayError(firstweekday)
|
|
||||||
self._firstweekday = firstweekday
|
self._firstweekday = firstweekday
|
||||||
firstweekday = property(getfirstweekday, setfirstweekday)
|
firstweekday = property(getfirstweekday, setfirstweekday)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue