def _DateEvent_PyGetDate(self): """ Return the date as a Python datetime.date object. """ return wx.wxdate2pydate(self.GetDate())
def test_datetimeConvertHelpers(self): d1 = wx.DateTime(1, wx.DateTime.Mar, 2012, 8, 15, 45) pd = wx.wxdate2pydate(d1) d2 = wx.pydate2wxdate(pd) self.assertTrue(isinstance(pd, datetime.datetime)) self.assertEqual(d1, d2)
def get_value(self): value = super(DatePicker, self).get_value() if hasattr(wx, "wxdate2pydate"): return wx.wxdate2pydate(value) return datetime.date(value.year, value.month, value.day)
def OnDateChanged2(self, evt): print("OnDateChanged2: %s\n" % evt.GetDate()) # self.log.write("OnDateChanged2: %s\n" % evt.GetDate()) self.enddate = self.getTodayDate(wx.wxdate2pydate(evt.GetDate()), 1) print("OnDateChanged2 enddate: %s\n" % self.enddate) pass
def OnDateChanged(self, evt): print("OnDateChanged: %s\n" % evt.GetDate()) # self.log.write("OnDateChanged: %s\n" % evt.GetDate()) self.startdate = self.getTodayDate(wx.wxdate2pydate(evt.GetDate()), 0) print("OnDateChanged2 startdate: %s\n" % self.startdate) pass
def _GenericCalendarCtrl_PyGetDate(self): """ Return the date as a Python datetime.date object. """ return wx.wxdate2pydate(self.GetDate())