Module: Tasks::CollectionObjects::AreaAndDate::AreaAndDateHelper

Defined in:
app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) get_first_created_at



20
21
22
23
24
25
26
27
# File 'app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb', line 20

def get_first_created_at
  colobj = CollectionObject.with_project_id(sessions_current_project_id).first_created
  if colobj.blank?
    Utilities::Dates::EARLIEST_DATE # 1700/01/01
  else
    colobj.created_at.to_date.strftime('%Y/%m/%d')
  end
end

- (Object) get_last_created_at



29
30
31
32
33
34
35
36
# File 'app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb', line 29

def get_last_created_at
  colobj = CollectionObject.with_project_id(sessions_current_project_id).last_created
  if colobj.blank?
    Date.today.strftime('%Y/%m/%d')
  else
    colobj.created_at.to_date.strftime('%Y/%m/%d')
  end
end

- (Object) id_range_select_tag(id_range_element, option_list)



16
17
18
# File 'app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb', line 16

def id_range_select_tag(id_range_element, option_list)
  select_tag(id_range_element, options_for_select(option_list), prompt: 'Select an identifier')
end

- (Object) paging



10
11
12
13
14
# File 'app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb', line 10

def paging
  if @collection_objects.any?
    paginate(@collection_objects, :remote => true)
  end
end

- (Object) paging_info



3
4
5
6
7
8
# File 'app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb', line 3

def paging_info
  # <p><%= page_entries_info(@collection_objects) %></p> <%= paginate @collection_objects %>
  if @collection_objects.any?
    page_entries_info(@collection_objects)
  end
end