Hacker News new | ask | show | jobs
by OscarCunningham 891 days ago
For January and February dates, the 'Memorable date' is adjusted based on whether it's a leap year or not. Would it be easier to pretend that they are part of the previous year, by subtracting 1 from the year whenever the month is January and February? That way the check for leap years is baked into the calculation you're already doing based on the year.