Sha256: 6a3a43d93468422c59e43b4b4af800f74c8d4fb29511efdd193e5fc1fa87f1b9
Contents?: true
Size: 910 Bytes
Versions: 8
Compression:
Stored size: 910 Bytes
Contents
# frozen_string_literal: true module Decidim module ParticipatoryProcesses # Helpers related to the Participatory Process layout. module ParticipatoryProcessHelper include Decidim::FiltersHelper include Decidim::AttachmentsHelper include Decidim::IconHelper include Decidim::WidgetUrlsHelper include Decidim::SanitizeHelper include Decidim::ResourceReferenceHelper # Public: Returns the dates for a step in a readable format like # "2016-01-01 - 2016-02-05". # # participatory_process_step - The step to format to # # Returns a String with the formatted dates. def step_dates(participatory_process_step) dates = [participatory_process_step.start_date, participatory_process_step.end_date] dates.map { |date| date ? localize(date.to_date, format: :default) : "?" }.join(" - ") end end end end
Version data entries
8 entries across 8 versions & 1 rubygems