Skip to content

Instantly share code, notes, and snippets.

@shigeya
Created August 8, 2012 13:03
Show Gist options
  • Save shigeya/3294919 to your computer and use it in GitHub Desktop.
Save shigeya/3294919 to your computer and use it in GitHub Desktop.
script to show list of days suitable for choseisan.com input
#!/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