code: def _EncodeDateField(field, value):
      
      if field.repeated:
          result = [d.isoformat() for d in value]
      else:
          result = value.isoformat()
      return encoding.CodecResult(value=result, complete=True)
docs: Encoder for datetime.date objects.