From 81f5c21f43717ed6367357ff751f5941c70f1e2a Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 9 Aug 2016 22:07:21 -0700 Subject: [PATCH] Padded arrival and departure with one extra day --- app/helpers/application_helper.rb | 2 ++ app/views/conferences/_questions.html.haml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 26fc685..c7dda52 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -754,6 +754,8 @@ module ApplicationHelper belongs_to_periods = [] belongs_to_periods << :before if day <= conference.start_date belongs_to_periods << :after if day >= conference.end_date + belongs_to_periods << :before_plus_one if day <= (conference.start_date + 1.day) + belongs_to_periods << :after_minus_one if day >= (conference.end_date - 1.day) belongs_to_periods << :during if day >= conference.start_date && day <= conference.end_date days << [date(day.to_date, format || :span_same_year_date_1), day] if belongs_to_periods.include?(period) end diff --git a/app/views/conferences/_questions.html.haml b/app/views/conferences/_questions.html.haml index ca9b29e..bd932be 100644 --- a/app/views/conferences/_questions.html.haml +++ b/app/views/conferences/_questions.html.haml @@ -4,8 +4,8 @@ = columns(medium: 12) do = radiobuttons :housing, ConferenceRegistration.all_housing_options, @registration.housing, 'articles.conference_registration.questions.housing', heading: 'articles.conference_registration.headings.housing', vertical: true, big: true, inline: true = fieldset :hosting_dates, heading: 'articles.conference_registration.headings.arrival_and_departure', vars: { city: @this_conference.location.city } do - = selectfield :arrival, @registration.arrival || @this_conference.start_date, conference_days_options_list(:before) - = selectfield :departure, @registration.departure || @this_conference.start_date, conference_days_options_list(:after) + = selectfield :arrival, @registration.arrival || @this_conference.start_date, conference_days_options_list(:before_plus_one) + = selectfield :departure, @registration.departure || @this_conference.start_date, conference_days_options_list(:after_minus_one) = radiobuttons :bike, ConferenceRegistration.all_bike_options, @registration.bike, 'articles.conference_registration.questions.bike', heading: 'articles.conference_registration.headings.bike', inline: true, big: true = radiobuttons :food, ConferenceRegistration.all_food_options, @registration.food, 'articles.conference_registration.questions.food', heading: 'articles.conference_registration.headings.food', inline: true, big: true = emailfield :companion, (@registration.housing_data['companions'] || [nil]).first, heading: 'articles.conference_registration.headings.companion', help: 'articles.conference_registration.paragraphs.companion', big: true