diff --git a/wxPython/src/_datetime.i b/wxPython/src/_datetime.i index da3bd3099e..197eeafe04 100644 --- a/wxPython/src/_datetime.i +++ b/wxPython/src/_datetime.i @@ -809,9 +809,15 @@ public: %pythoncode { def __repr__(self): - return '' % ( self.Format(), self.this) + if self.IsValid(): + return '' % ( self.Format(), self.this) + else: + return '' % self.this def __str__(self): - return self.Format() + if self.IsValid(): + return self.Format() + else: + return "INVALID DateTime" } }; @@ -955,7 +961,7 @@ public: %pythoncode { def __repr__(self): - return '' % ( self.Format(), self.this) + return '' % ( self.Format(), self.this) def __str__(self): return self.Format() }