def parse(self, value):
        value = super(DateOpt, self).parse(value)
        if value is None:
            return None
        if isinstance(value, str):
            value = self.parse_date(value)
        if isinstance(value, datetime) and self.date_only:
            value = value.date()
        return value
Parse date
dataset/ETHPy150Open heigeo/climata/climata/base.py/DateOpt.parse