I am working on a project where the requirement is to have a date calculated as being the last Friday of a given month. I think I have a solution that only uses standard Ja
You need to know two things - the number of days in the month, and the weekday the first of the month falls on.
If the first day of the month is a
There are only three special cases. A single switch statement and three if statements (or ternary operators if you like every case to have a single line...)
Work it out on paper. Don't need any special libraries, functions, julian conversions, etc (well, except to get the weekday the 1st falls on, and maybe the number of days that month... )
Aaron implemented it in Java.
-Adam