Created
January 6, 2009 10:55
-
-
Save andreyvit/43766 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
def print_timesheet(first, last) | |
last_month = nil | |
first.upto(last) do |cur| | |
if last_month != cur.mon | |
puts | |
puts Date::MONTHNAMES[cur.mon] | |
puts | |
last_month = cur.mon | |
end | |
puts sprintf("%02d.%02d %03s\t 0\t-", cur.day, cur.mon, Date::ABBR_DAYNAMES[cur.wday]) | |
puts if cur.wday == 0 | |
end | |
end | |
print_timesheet Date.civil(2008, 05, 01), Date.civil(2009, 01, 01) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment