Framework CCCS page

This commit is contained in:
Stefan Schlott 2013-09-05 09:51:17 +02:00
parent 09aba964a9
commit 8f812ab935
319 changed files with 24165 additions and 50 deletions

35
scripts/generate-stammtisch.rb Executable file
View file

@ -0,0 +1,35 @@
#!/usr/bin/env ruby
# encoding: utf-8
require 'date'
require 'yaml'
def event(day, dayoffset, location)
startDate = Time.local(day.year, day.month, day.day + dayoffset, 18, 0, 0)
{
'startdate' => startDate,
'duration' => '4h',
'location' => {
'location' => location
}
}
end
year=ARGV[0].to_i
result = { 'events' => [] }
for month in 1..12
date = Date.new(year,month,1)
firsttuesday = if (date.wday<=2)
date + (2-date.wday)
else
date + (9-date.wday)
end
result['events'] << event(firsttuesday, 0, 'zadu')
result['events'] << event(firsttuesday, 15, 'shack')
end
puts result.to_yaml