def start(self): """ Check that the start date has the correct format. Convert to datetime.date format """ if type(self._start) != datetime.date: self._start,check = stock_helper.check_date_format(self._start) if check == 'fail': print ('please use the correct format for the date, dd/mm/yyyy') del self sys.exit() return self._start
def end(self): """ Check that the end date has the correct format. Convert to datetime.date format Then check that the end date is later than the start date """ if type(self._end) != datetime.date: self._end,check = stock_helper.check_date_format(self._end) if check == 'fail': print ('please use the correct format for the date, dd/mm/yyyy') del self sys.exit() if self._start > self._end: print ('The start date must be prior to the end date') del self sys.exit() return self._end