   """
 
   @enforce_keys [:year, :month, :day, :hour, :minute, :second]
-  defstruct [:year, :month, :day, :hour, :minute, :second, microsecond: {0, 0}, calendar: Calendar.ISO]
-
-  @type t :: %NaiveDateTime{year: Calendar.year, month: Calendar.month, day: Calendar.day,
-                            calendar: Calendar.calendar, hour: Calendar.hour, minute: Calendar.minute,
-                            second: Calendar.second, microsecond: Calendar.microsecond}
+  defstruct [
+    :year,
+    :month,
+    :day,
+    :hour,
+    :minute,
+    :second,
+    microsecond: {0, 0},
+    calendar: Calendar.ISO
+  ]
+
+  @type t :: %NaiveDateTime{
+          year: Calendar.year(),
+          month: Calendar.month(),
+          day: Calendar.day(),
+          calendar: Calendar.calendar(),
+          hour: Calendar.hour(),
+          minute: Calendar.minute(),
+          second: Calendar.second(),
+          microsecond: Calendar.microsecond()
+        }
 
   @doc """
   Returns the current naive datetime in UTC.

      "2000-02-29 23:00:07"

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

  def to_string(%{calendar: calendar, year: year, month: month, day: day,
                  hour: hour, minute: minute, second: second, microsecond: microsecond}) do
    calendar.naive_datetime_to_string(year, month, day, hour, minute, second, microsecond)
  end


      {:error, :invalid_format}

  """
  @spec from_iso8601(String.t(), Calendar.calendar()) :: {:ok, t} | {:error, atom}
  def from_iso8601(string, calendar \\ Calendar.ISO)

  def from_iso8601(
        <<
          year::4-bytes,
          ?-,
          month::2-bytes,
          ?-,
          day::2-bytes,
          sep,
          hour::2-bytes,
          ?:,
          min::2-bytes,
          ?:,
          sec::2-bytes,
          rest::binary
        >>,
        calendar
      )
      when sep in [?\s, ?T] do
    with {year, ""} <- Integer.parse(year),
         {month, ""} <- Integer.parse(month),
         {day, ""} <- Integer.parse(day),
