Yup, you're right. I don't know where my head was when I did the post. I've actually used dateadd() and datediff() and not had to do anything about leap year at all!! You'd think I would have know better...
You may not need to know if the year is leap or not:
You can always do the Following
1. Find next month number
2. create the First Day of that next month
3. Substract 3 days of the above date
and you don't need to know anything about leap-year
"See how deep the rabbit holes goes..."
"See how deep the rabbit hole goes..."