 
   @impl true
   def valid_date?(year, month, day) do
-    year <= 9999 and :calendar.valid_date(year, month, day)
+    month in 1..12 and
+      year in 0..9999 and
+      day in 1..days_in_month(year, month)
   end
 
   @impl true

  @impl true
  def day_of_week(year, month, day)
      when is_integer(year) and is_integer(month) and is_integer(day) do
    :calendar.day_of_the_week(year, month, day)
  end

  @doc """

    if total in @unix_range_microseconds do
      microsecond = rem(total, 1_000_000)
      precision = precision_for_unit(unit)
      {date, time} = iso_seconds_to_datetime(@unix_epoch + div(total, 1_000_000))
      {:ok, date, time, {microsecond, precision}}
    else
      {:error, :invalid_unix_time}
