def onDateChanged(self, event):

        date = self.dpStartDate.GetValue()
        startDate = datetime.datetime(date.Year, date.Month + 1, date.Day, 0, 0, 0)
        date = self.dpEndDate.GetValue()
        endDate = datetime.datetime(date.Year, date.Month + 1, date.Day, 0, 0, 0)

        # check conditions
        logger.debug("startDate: %s" % (startDate))
        logger.debug("endDate: %s" % (endDate))

        if startDate.date() <= endDate.date():
            endDate = endDate.replace(hour=11, minute=59, second=59)
        else:
            startDate = startDate.replace(hour=11, minute=59, second=59)

        Publisher.sendMessage("onDateChanged", startDate=startDate, endDate=endDate)
        event.Skip()
dataset/ETHPy150Open ODM2/ODMToolsPython/odmtools/gui/mnuRibbon.py/mnuRibbon.onDateChanged/original