Fix datetime.date encoding error.