Timex Compare - granularity options

Hi guys,

I am confused by Timex Compare, the granularity options:
https://hexdocs.pm/timex/Timex.html#compare/3

* :year
* :years
* :month
* :months
* :week
* :weeks

What is difference between year , years ? Why are there even 2 options?
I can’t get a different result between these 2 options but on the other hand I need to be 100% I choose the right one.

I am in particular interested in day vs days. I just need to compare on a day in a date.

Thanks

2 Likes

As far as I know there is no difference, it’s just to make it so you can type day or days without worrying whether you need an ‘s’ or not, so just use whichever makes sense for what you are using it for. :slight_smile:

Sounds like you could do a documentation PR to fix it though? :slight_smile:

1 Like

Thanks! https://github.com/bitwalker/timex/pull/561

1 Like