     {year, month, day} = Calendar.ISO.date_from_iso_days(days)
     %Date{year: year, month: month, day: day, calendar: Calendar.ISO}
   end
+
   defp from_iso_days(iso_days, target_calendar) do
     {year, month, day, _, _, _, _} = target_calendar.naive_datetime_from_iso_days(iso_days)
     %Date{year: year, month: month, day: day, calendar: target_calendar}

      "2000-02-28"

  """
  @spec to_string(Calendar.date) :: String.t
  def to_string(date)

  def to_string(%{calendar: calendar, year: year, month: month, day: day}) do

      {:ok, %Date{calendar: Calendar.Holocene, year: 12000, month: 1, day: 1}}

  """
  @spec convert(Calendar.date(), Calendar.calendar()) ::
          {:ok, t} | {:error, :incompatible_calendars}
  def convert(%{calendar: calendar, year: year, month: month, day: day}, calendar) do
    {:ok, %Date{calendar: calendar, year: year, month: month, day: day}}
  end

  def convert(%{calendar: calendar} = date, target_calendar) do
    if Calendar.compatible_calendars?(calendar, target_calendar) do
      result_date =
        date
        |> to_iso_days()
        |> from_iso_days(target_calendar)

      {:ok, result_date}
    else
      {:error, :incompatible_calendars}
