calendar_interval icon indicating copy to clipboard operation
calendar_interval copied to clipboard

Change `Enumerable.member?` implementation to take precision into account

Open wojtekmach opened this issue 4 years ago • 1 comments

Ref https://github.com/wojtekmach/calendar_interval/pull/6#discussion_r323873568

wojtekmach avatar Sep 28 '19 11:09 wojtekmach

tl;dr we're currently, arguably, breaking the enumerable contract, see this discrepancy:

iex> ~D[2020-01-01] in ~I"2020-01/12"
true

iex> Enum.filter(~I"2020-01/12", & &1 == ~D[2020-01-01])
[]

the change would be to make:

iex> ~D[2020-01-01] in ~I"2020-01/12"
false

@kipcole9 would making this change break your apps?

wojtekmach avatar May 29 '20 10:05 wojtekmach