7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'app/pb_kits/playbook/pb_dropdown/quickpick_helper.rb', line 7
def get_quickpick_options(range_ends_today: false, custom_quick_pick_dates: {})
default_options = build_default_options(range_ends_today)
return default_options if custom_quick_pick_dates.blank?
dates = custom_quick_pick_dates[:dates] || custom_quick_pick_dates["dates"]
return default_options if dates.blank?
custom_options = dates.map { |date_config| build_custom_option(date_config) }
override = custom_quick_pick_dates[:override]
override = custom_quick_pick_dates["override"] if override.nil?
if override == false
default_options + custom_options
else
custom_options
end
end
|