Hi,
Trying to figure out why in Phoenix all times are marked as invalid.
I don't (didn't) understand the code in maskededit._validateTime:
try:
checkTime = dateHandler.ParseTime(value)
valid = checkTime == len(value)
ParseTime returns True or False (see ParseTime and ParseFormat in docs.wxwidgets.org/2.9/classwx_date_time.html) , so how could that ever have worked, as the len(value) can never be equal.
Hhm, just debugged it using wxPython 2.9.5 and there ParseTime returns "11" for a time string of u"12:00:00 AM".
Was ParseTime changed on purpose to just return True/False or ...?
I was going to just use "IsValid" on dateHandler, but dateHandler.ParseTime does not actually set the time to the given value.
Any suggestion on how the value could be checked to be valid?
Werner
Hi,
Noted this change set:
http://trac.wxwidgets.org/changeset/73330
Seems that Robin tweaked things in the past and this probably didn't make it to Phoenix.
Or maybe change ParseTime signature to match wxWidgets:
ParseTime(time, end).
Werner
···
On 6/26/2014 10:54, Werner wrote:
Hi,
Trying to figure out why in Phoenix all times are marked as invalid.
I don't (didn't) understand the code in maskededit._validateTime:
try:
checkTime = dateHandler.ParseTime(value)
valid = checkTime == len(value)
ParseTime returns True or False (see ParseTime and ParseFormat in
docs.wxwidgets.org/2.9/classwx_date_time.html) , so how could that
ever have worked, as the len(value) can never be equal.
Hhm, just debugged it using wxPython 2.9.5 and there ParseTime returns
"11" for a time string of u"12:00:00 AM".
Was ParseTime changed on purpose to just return True/False or ...?
I was going to just use "IsValid" on dateHandler, but
dateHandler.ParseTime does not actually set the time to the given value.
Any suggestion on how the value could be checked to be valid?
Werner