Fix a bug in filtering of date fields.