getting dates in week

Timothy Smith wrote:

hello people, i want to click on a day in the calendar ctrl and get the next 7 days after it.
currently the way i do it is i loop through 7 times and do this:
self.RosterCalendar.GetDate().SetDay(self.RosterCalendar.GetDate().GetDay()+1)

the problem i come across is if i each the end of the month, the dates go back to 1970/01/01!!
is there a better way to do this? can i some how return all the dates in the selected week?

Use a wx.DateSpan and add it to the wx.DateTime object:

>>> date = wx.DateTime_Today()
>>> week = wx.DateSpan(days=7)
>>> date
<wx.DateTime: "Thu 27 Jan 2005 12:00:00 AM PST" at _80e53e08_p_wxDateTime>
>>> date + week
<wx.DateTime: "Thu 03 Feb 2005 12:00:00 AM PST" at _08c04108_p_wxDateTime>

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!