Last active
August 29, 2015 14:12
-
-
Save zakuroishikuro/50286e86924383a5634d to your computer and use it in GitHub Desktop.
プロ生ちゃんのカレンダーのあれ (Ruby) ref: http://qiita.com/zakuroishikuro/items/6a1cdc48609875b8e131
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' | |
last = Date.new(Time.now.year, Time.now.month, -1) | |
days = (1..last.day).map{|d| '%2d' % d} | |
days.unshift *[nil] * (last + 1 << 1).wday | |
puts last.strftime "%B %Y" | |
puts days.each_slice(7).map{|week| week * "\t"} |
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
January 2015 | |
1 2 3 | |
4 5 6 7 8 9 10 | |
11 12 13 14 15 16 17 | |
18 19 20 21 22 23 24 | |
25 26 27 28 29 30 31 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment