I’ve found converting the month and day for this exercise fairly straightforward. The big issue I’m running into is the logic behind if/when to print the year. I’ve written the following sudocode to break down the different scenarios:
-if dates are < 3 months apart && occurred recently --> no year is printed. -if dates are < 12 months apart && occur in the future --> the starting year is printed. ending year not necessary. -if date are > 12 months apart --> both start & end years are printed. -if dates are the same day --> that full day's date is printed.
Whoa. Where & how do I begin to implement this?! It seems to me I need to calculate the distance between the two dates and go from there. Is this correct or am I over complicating matters?