Is there a way to calculate the day of the year considering leap years