Generate qr code for flyers

This commit is contained in:
Stefan Schlott 2013-09-05 16:49:22 +02:00
parent a563710a69
commit a43bf169a0
5 changed files with 56 additions and 4 deletions

View file

@ -26,8 +26,8 @@ def get_public_events()
items.select { |i| (i[:kind]=='event') && i[:public] }
end
def calculate_to_dates()
items.select { |i| (i[:kind]=='event') && i[:duration] }.each do |e|
def calculate_to_date(e)
if e[:duration]
if e[:startdate].instance_of?(Date)
if e[:duration] =~ /(\d+)d/
e[:enddate] = e[:startdate] + ($1.to_i - 1)
@ -43,6 +43,12 @@ def calculate_to_dates()
end
end
def calculate_to_dates()
items.select { |i| (i[:kind]=='event') && i[:duration] }.each do |e|
calculate_to_date(e)
end
end
def conv_tz(t)
if (t.utc?)
Time.local(t.year, t.month, t.day, t.hour, t.min, t.sec)