From afc43a983cce6ae37ebc2491e4cf4fbb00f99c65 Mon Sep 17 00:00:00 2001 From: Seth Jeffery Date: Sun, 20 Nov 2016 19:30:46 +0000 Subject: [PATCH] add ability to specify start_date in form helper --- lib/schedulable/form_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/schedulable/form_helper.rb b/lib/schedulable/form_helper.rb index a97f615..887481d 100644 --- a/lib/schedulable/form_helper.rb +++ b/lib/schedulable/form_helper.rb @@ -124,8 +124,8 @@ def schedule_select(attribute, input_options = {}) # Date Select - @template.content_tag("div", style_options[:field_html].merge({data: {group: 'singular'}})) do - content_wrap(@template, f.label(:date, style_options[:label_html]), style_options[:label_wrapper]) << + @template.content_tag("div", style_options[:field_html].merge({data: {group: input_options[:from] ? 'singular,daily,weekly,monthly' : 'singular'}})) do + content_wrap(@template, f.label(:date, style_options[:label_html].merge({ data: {group: 'singular'}})) << f.label(:start_date, style_options[:label_html].merge({ data: {group: 'daily,weekly,monthly'}})), style_options[:label_wrapper]) << content_wrap(@template, f.send(input_types[:date].to_sym, *[:date].concat(f.method(input_types[:date].to_sym).parameters.count >= 3 ? [date_options] : []).concat([style_options[:date_select_html].clone])), style_options[:date_select_wrapper]) end <<