Originally posted by bvdet
assume that I have self._month, self._day, self._year has been property defined.
I have two list of maximum day for regular year and leap year.
I would like to write a nextDate() method to increase one day of current date, how can I write it?
[code=python]
class CalculationDate :
daysList1 = [31,28,31,30,31, 30,31,31,30,31, 30,31]
daysList2 = [31,29,31,30,31, 30,31,31,30,31, 30,31]
def __ini__(m, d, yr):
self._month...
self._day...
self._year... # all of these things are written properly if user enters invalid information date, it will ask to change the date.
#now I would like to have a nextDay method:
def nextDay(self):
# how can I write this
[/code]
Comment