News for hackers. Stuff that matters.
Re:Ask HN: Did you encounter any leap year bugs today? by DinaCoder99 on Thursday February 29, 2024 @09:01PM (#39557670)
> distance_of_time_in_words(Date.new(2025, 2, 28), Date.new(2024, 2, 28))

Curiously, this is also not quite a year, even though the days and months are the same.

Re:Ask HN: Did you encounter any leap year bugs today? by mr_toad on Thursday February 29, 2024 @09:17PM (#39557788)
It’s probably comparing the number of days between the dates with the number of days in a year, which would usually work.
Re:Ask HN: Did you encounter any leap year bugs today? by EnigmaticLion on Friday March 01, 2024 @01:58AM (#39559298)
Source is a lot more complicated than i thought it will be: https://github.com/rails/rails/blob/v6.1.7.7/actionview/lib/...