diff --git a/lib/parse/datetime/helpers.ex b/lib/parse/datetime/helpers.ex index 33fed705..eb78d1ff 100644 --- a/lib/parse/datetime/helpers.ex +++ b/lib/parse/datetime/helpers.ex @@ -159,13 +159,13 @@ defmodule Timex.Parse.DateTime.Helpers do case {padding, min_width, max_width} do {:zeroes, _, nil} -> Text.integer() - {:zeroes, min, max} -> choice(Enum.map(max..min//-1, &fixed_integer(&1))) + {:zeroes, min, max} -> choice(Enum.map(Range.new(max, min, -1), &fixed_integer(&1))) {:spaces, -1, nil} -> skip(spaces()) |> Text.integer() {:spaces, min, nil} -> skip(spaces()) |> fixed_integer(min) - {:spaces, _, max} -> skip(spaces()) |> choice(Enum.map(max..1//-1, &fixed_integer(&1))) + {:spaces, _, max} -> skip(spaces()) |> choice(Enum.map(Range.new(max, 1, -1), &fixed_integer(&1))) {_, -1, nil} -> Text.integer() {_, min, nil} -> fixed_integer(min) - {_, min, max} -> choice(Enum.map(max..min//-1, &fixed_integer(&1))) + {_, min, max} -> choice(Enum.map(Range.new(max, min, -1), &fixed_integer(&1))) end end end