You should have a calendar table of dates (F_TABLE_DATE by Michael Valentine Jones, which can be found in the scripts forum here, is very useful), everything else you asked for can be derived from that table. Let the front-end do the formatting.