Created
August 8, 2012 13:03
-
-
Save shigeya/3294919 to your computer and use it in GitHub Desktop.
script to show list of days suitable for choseisan.com input
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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
# | |
# Create list of lines of days with day of week | |
# suitable for http://chouseisan.com input | |
# | |
require 'date' | |
day = Date.today | |
count = 14 | |
if ARGV.count == 1 && ARGV[0] == "--help" | |
puts "usage: ckdlist [day] [count]" | |
exit | |
end | |
day = Date.parse(ARGV[0], true) if ARGV.count >= 1 | |
count = ARGV[1].to_i if ARGV.count == 2 | |
(0..count-1).each {|n| puts (day + n).strftime("%m/%d (%a)") } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment