code: def field_date_to_json(self, day):
          
          if isinstance(day, six.string_types):
              day = parse_date(day)
          return [day.year, day.month, day.day] if day else None
docs: Convert a date to a date triple.