module EventsHelper
	def event_human_date(event, date_format = "%A %e %B %Y", time_format = "%kh%M")

		if event.entire_day?
			if event.stop_date?
				if event.start_at.strftime('%d/%m/%Y') == event.stop_at.strftime('%d/%m/%Y')
					"le <strong>#{l(event.start_at, :format => date_format)}</strong>"
				else
					"du <strong>#{l(event.start_at, :format => date_format)}</strong> au <strong>#{l(event.stop_at, :format => date_format)}</strong>"
				end
			else
				"le <strong>#{l(event.start_at, :format => date_format)}</strong>"
			end
		else
			if event.stop_date?
				if event.start_at.strftime('%d/%m/%Y') == event.stop_at.strftime('%d/%m/%Y')
					"le <strong>#{l(event.start_at, :format => date_format)}</strong> de <strong>#{l(event.start_at, :format => time_format)}</strong> à <strong>#{l(event.stop_at, :format => time_format)}</strong> "
				else
					"du <strong>#{l(event.start_at, :format => date_format)}</strong> à <strong>#{l(event.start_at, :format => time_format)}</strong> au <strong>#{l(event.stop_at, :format => date_format)}</strong> à <strong>#{l(event.stop_at, :format => time_format)}</strong> "
				end
			else
				"le <strong>#{l(event.start_at, :format => date_format)}</strong> à <strong>#{l(event.start_at, :format => time_format)}</strong>"
			end
		end

	end
end
