Skip to content

Instantly share code, notes, and snippets.

@6david9
Created November 15, 2021 17:44
Show Gist options
  • Save 6david9/66b09a17a02c5259a754ee2369affb2e to your computer and use it in GitHub Desktop.
Save 6david9/66b09a17a02c5259a754ee2369affb2e to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require "date"
class Date
def weekday
case self.wday
when 0 then "日"
when 1 then "一"
when 2 then "二"
when 3 then "三"
when 4 then "四"
when 5 then "五"
when 6 then "六"
end
end
end
now = Date.today
monday = now - (now.wday - 1) % 7
7.times do |n|
day = monday + n
puts "(#{day.weekday}) #{day.mon}-#{day.mday}"
end
#!/usr/bin/env ruby
require "date"
class Date
def weekday
case self.wday
when 0 then "日"
when 1 then "一"
when 2 then "二"
when 3 then "三"
when 4 then "四"
when 5 then "五"
when 6 then "六"
end
end
end
now = Date.today
monday = now - (now.wday - 1) % 7
5.times do |n|
day = monday + n
puts "(#{day.weekday}) #{day.mon}-#{day.mday}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment