Add
```python
if isinstance(value, datetime.datetime):
    value = value.date()
```