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

Version Path
decidim-participatory_processes-0.22.0 app/helpers/decidim/participatory_processes/participatory_process_helper.rb
decidim-participatory_processes-0.21.0 app/helpers/decidim/participatory_processes/participatory_process_helper.rb
decidim-participatory_processes-0.20.1 app/helpers/decidim/participatory_processes/participatory_process_helper.rb
decidim-participatory_processes-0.20.0 app/helpers/decidim/participatory_processes/participatory_process_helper.rb
decidim-participatory_processes-0.19.1 app/helpers/decidim/participatory_processes/participatory_process_helper.rb
decidim-participatory_processes-0.18.1 app/helpers/decidim/participatory_processes/participatory_process_helper.rb
decidim-participatory_processes-0.19.0 app/helpers/decidim/participatory_processes/participatory_process_helper.rb
decidim-participatory_processes-0.18.0 app/helpers/decidim/participatory_processes/participatory_process_helper.rb