rjustで改修
This commit is contained in:
parent
b5e339c51a
commit
00dfd30932
1 changed files with 2 additions and 11 deletions
13
cal.rb
13
cal.rb
|
@ -20,18 +20,9 @@ puts week.join(' ')
|
|||
print "\s\s\s" * first_day.wday
|
||||
|
||||
(first_day..last_day).each do |date|
|
||||
day_string = date.day.to_s.rjust(2, ' ')
|
||||
day_string = date.day.to_s.rjust(2, "\s")
|
||||
day_string = "\e[7m#{day_string}\e[0m" if date == Date.today
|
||||
print day_string
|
||||
print "#{day_string}\s"
|
||||
puts if date.saturday?
|
||||
end
|
||||
puts
|
||||
|
||||
# print "#{date.day.to_s.rjust(2)}\s"
|
||||
# date += 1
|
||||
# print "\n" if date.sunday?
|
||||
# if date == Date.today && ARGV == [] # 引数なしなら現在日をハイライトする
|
||||
# print "\e[7m\e[7m"
|
||||
# else
|
||||
# print "\e[0m"
|
||||
# end
|
||||
|
|
Loading…
Reference in a new issue