   end
 
   defp days_in_previous_years(0), do: 0
+
   defp days_in_previous_years(year) do
     previous_year = year - 1
-    Integer.floor_div(previous_year, 4) -
-      Integer.floor_div(previous_year, 100) +
-      Integer.floor_div(previous_year, 400) +
-      previous_year * @days_per_nonleap_year + @days_per_leap_year
+
+    Integer.floor_div(previous_year, 4) - Integer.floor_div(previous_year, 100) +
+      Integer.floor_div(previous_year, 400) + previous_year * @days_per_nonleap_year +
+      @days_per_leap_year
   end
 
   # Note that 0 is the first day of the month.
   defp year_day_to_year_date(_extra_day, day_of_year) when day_of_year < 31 do
     {1, day_of_year}
   end
-  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < (59 + extra_day) do
+
+  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < 59 + extra_day do
     {2, day_of_year - 31}
   end
-  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < (90 + extra_day) do
+
+  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < 90 + extra_day do
     {3, day_of_year - (59 + extra_day)}
   end
-  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < (120 + extra_day) do
+
+  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < 120 + extra_day do
     {4, day_of_year - (90 + extra_day)}
   end
-  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < (151 + extra_day) do
+
+  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < 151 + extra_day do
     {5, day_of_year - (120 + extra_day)}
   end
-  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < (181 + extra_day) do
+
+  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < 181 + extra_day do
     {6, day_of_year - (151 + extra_day)}
   end
-  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < (212 + extra_day) do
+
+  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < 212 + extra_day do
     {7, day_of_year - (181 + extra_day)}
   end
-  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < (243 + extra_day) do
+
+  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < 243 + extra_day do
     {8, day_of_year - (212 + extra_day)}
   end
-  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < (273 + extra_day) do
+
+  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < 273 + extra_day do
     {9, day_of_year - (243 + extra_day)}
   end
-  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < (304 + extra_day) do
+
+  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < 304 + extra_day do
     {10, day_of_year - (273 + extra_day)}
   end
-  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < (334 + extra_day) do
+
+  defp year_day_to_year_date(extra_day, day_of_year) when day_of_year < 334 + extra_day do
     {11, day_of_year - (304 + extra_day)}
   end
+
   defp year_day_to_year_date(extra_day, day_of_year) do
     {12, day_of_year - (334 + extra_day)}
   end

  Convers the datetime (with time zone) into a string.
  """
  @impl true
  def datetime_to_string(year, month, day, hour, minute, second, microsecond,
                         time_zone, zone_abbr, utc_offset, std_offset) do
    date_to_string(year, month, day) <> " " <>
      time_to_string(hour, minute, second, microsecond) <>
      offset_to_string(utc_offset, std_offset, time_zone) <>
      zone_to_string(utc_offset, std_offset, zone_abbr, time_zone)

  @impl true
  def day_of_week(year, month, day)
      when is_integer(year) and is_integer(month) and is_integer(day) do
    Integer.mod(date_to_iso_days(year, month, day) + 5, 7) + 1
  end

  @doc """
