@ -46,6 +46,10 @@ module CollectionTimeHelper
current_collection_start_date - 1.year
end
def twice_previous_collection_start_year
current_collection_start_year - 2
def quarter_for_date(date: Time.zone.now)
quarters = [
{ quarter: "Q3", cutoff_date: Time.zone.local(2024, 1, 12), start_date: Time.zone.local(2023, 10, 1), end_date: Time.zone.local(2023, 12, 31) },
@ -93,11 +93,11 @@ module FiltersHelper
def collection_year_options
if FeatureToggle.collection_2024_2025_year_enabled?
{
{ "2024": "2024/25", "2023": "2023/24", "2022": "2022/23" }
current_collection_start_year.to_s => year_combo(current_collection_start_year),
else
previous_collection_start_year.to_s => year_combo(previous_collection_start_year),
{ "2023": "2023/24", "2022": "2022/23", "2021": "2021/22" }
twice_previous_collection_start_year.to_s => year_combo(twice_previous_collection_start_year),
}
def filters_applied_text(filter_type)
@ -1,8 +1,4 @@
class FeatureToggle
def self.collection_2024_2025_year_enabled?
!Rails.env.production?
# Disable check on preview apps to allow for testing of future forms
def self.saledate_collection_window_validation_enabled?
Rails.env.production? || Rails.env.test? || Rails.env.staging?