I am new to Elixir and trying to run some scripts from elixir documentation, testing Date structure gave a strange result because
Date.compare(~D[2016-04-16], ~D[2016-04-28]) is returning :lt
while when trying to run Date.diff(~D[2016-04-16], ~D[2016-04-28]) I am getting this error
(UndefinedFunctionError) function Date.diff/2 is undefined or private
(elixir) Date.diff(~D[2016-04-16], ~D[2016-04-28])
Date.diff/2 was added in Elixir 1.5 (as you can see here). I am pretty sure you are using previous version. By running elixir -v you can check what version you have currently installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With