Skip to content

Instantly share code, notes, and snippets.

@Coro365
Last active August 29, 2015 14:04
Embed
What would you like to do?
Calendar copy to clipboard
year = ARGV[0].to_i
mounth = ARGV[1].to_i
number = ARGV[2].to_i
#week set
week = ["Sum","Mon","Tue","Wed","Thu","Fri","Sta"]
#last day set
limits = [31,28,31,30,31,30,31,31,30,31,30,31]
limit = limits[mounth - 1]
#title print
print("#{year}.#{mounth}\n")
#days print
limit.times do |i|
print("#{year}.#{mounth}.#{i+1}(#{week[number]})\n\n")
number += 1
if number > 6
number = 0
end
end
#next commend
mounth += 1
if mounth > 12
mounth = 1
year += 1
end
print "ruby ~/Dropbox/Develop/Ruby/myDays.rb #{year} #{mounth} #{number} | pbcopy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment