Files
comma-scripts/,week

15 lines
238 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'date'
idx = ARGV[0] || '0'
idx = idx.to_i
today = Date.today + idx*7
monday = today - today.cwday + 1
sunday = monday + 6
puts "week-#{today.cweek}-#{monday.strftime('%m%d')}-#{sunday.strftime('%m%d')}"