I'm trying to pre-populate a wxPython DatePicker with a value using the following code:
month, day, year = runData[2][0:8].split('/')
displayDate = wx.DateTimeFromDMY(int(day), int(month) - 1, int(year))
self.datePicker.SetValue(displayDate)
Here are the printed values:
- runData[2] = 12/16/09 00:00
- month, day, year = 12 16 09
- displayDate = 12/16/09 00:00:00
But, datePicker always shows today's date instead.
Any ideas?
I'm using Python 2.6.4 with wxPython 2.8.10.1 on Windows 7.
Thanks.
Update 20/12/09 16:30:
When I try and process the information from the DatePickerCtrl with the problem, I get the following error:
Traceback (most recent call last):
File "test.py", line 1120, in onOk
dateLong = self.datePicker.GetValue()
File "c:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\_controls.py", line
6465, in GetValue
return _controls_.DatePickerCtrlBase_GetValue(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "m_date.IsValid() == dt.IsValid() && (!
dt.IsValid() || dt == m_date)" failed at ..\..\src\msw\datectrl.cpp(278) in wxDa
tePickerCtrl::GetValue(): bug in wxDatePickerCtrl: m_date not in sync
Am I missing something?