Problem with date difference calculation

(Jay Pfaffman) #1

This is here on meta. First post dated Aug 25, next post, “2 months later” dated today. This is a PM. First post in thread also not 2 months ago.

(Joshua Rosenfeld) #2

This was a recent change - the “x days/months/years” later used to round down, now it rounds up. Perhaps is should just “round”, instead of using floor or ceil.

cc @codinghorror @eviltrout

(Jeff Atwood) #3

Would that even be 1.5 @eviltrout?

(Jay Pfaffman) #4

OH! I guess this is the end of September, which is > 1 month.

No, but since it does ceil > 1 month = 2 months. Seems like you want round.

(Jeff Atwood) #5

Hmm the intent was for 1.0 - 1.499 to be “1 month” and 1.5 - 1.999 to be “2 months” @eviltrout.

(Neil Lalonde) #6

I changed it to use round.

(Jeff Atwood) closed #7