Skip to content
Snippets Groups Projects
Commit 3c18f71c authored by Anusha Ranganathan's avatar Anusha Ranganathan
Browse files

Merge branch 'fix/56_date_format_issue_in_search' into 'develop'

Fixed date format and field labels

Closes antleaf-projectmanagement#56

See merge request FDM/rdm-system/rdms!203
parents e4121619 b80e47bd
Branches
Tags
1 merge request!203Fixed date format and field labels
Pipeline #9560 failed
......@@ -72,11 +72,13 @@ class CatalogController < ApplicationController
range: {
num_segments: 10,
assumed_boundaries: [1100, Time.now.year + 2],
segments: false,
segments: true,
maxlength: 4
}
elsif fld.end_with?("_dtsim")
config.add_facet_field fld, limit: 5, label: I18n.t("blacklight.search.fields.facet.#{fld}"), helper_method: :facet_fields_date_format
else
config.add_facet_field fld, limit: 5
config.add_facet_field fld, limit: 5, label: I18n.t("blacklight.search.fields.facet.#{fld}")
end
end
......
......@@ -84,4 +84,8 @@ module HyraxHelper
def is_permanently_tombstoned?(presenter)
presenter.tombstone_status == ['deleted'] && presenter.is_tombstoned
end
def facet_fields_date_format(date)
date.to_date.strftime('%Y-%m-%d')
end
end
......@@ -74,7 +74,7 @@ module ComplexField
date_options = DateService.new.select_all_options
date_options.each do |d|
fields << Solrizer.solr_name("complex_date_#{d[0].downcase.tr(' ', '_')}", :dateable)
# fields << Solrizer.solr_name("complex_year_#{d[0].downcase.tr(' ', '_')}", :facetable)
fields << "complex_year_#{d[0].downcase.tr(' ', '_')}_itsi"
end
fields
end
......
......@@ -14,28 +14,29 @@ en:
subject_sim: Subject
# complex date
complex_date_dtsim: Date
complex_year_itsi: Year
complex_date_accepted_dtsim: Date accepted
complex_year_accepted_sim: Year accepted
complex_year_accepted_itsi: Year accepted
complex_date_available_dtsim: Date available
complex_year_available_sim: Year available
complex_year_available_itsi: Year available
complex_date_copyrighted_dtsim: Date copyrighted
complex_year_copyrighted_sim: Year copyrighted
complex_year_copyrighted_itsi: Year copyrighted
complex_date_collected_dtsim: Date collected
complex_year_collected_sim: Year collected
complex_year_collected_itsi: Year collected
complex_date_created_dtsim: Date created
complex_year_created_sim: Year created
complex_year_created_itsi: Year created
complex_date_deposited_dtsim: Date deposited
complex_year_deposited_sim: Year deposited
complex_year_deposited_itsi: Year deposited
complex_date_recorded_dtsim: Date recorded
complex_year_recorded_sim: Year recorded
complex_year_recorded_itsi: Year recorded
complex_date_registered_dtsim: Date registered
complex_year_registered_sim: Year registered
complex_year_registered_itsi: Year registered
complex_date_published_dtsim: Date published
complex_year_published_sim: Year published
complex_year_published_itsi: Year published
complex_date_submitted_dtsim: Date submitted
complex_year_submitted_sim: Year submitted
complex_year_submitted_itsi: Year submitted
complex_date_updated_dtsim: Date updated
complex_year_updated_sim: Year updated
complex_year_updated_itsi: Year updated
# complex funder
funder_sim: Funder
# complex identifier
......@@ -62,6 +63,8 @@ en:
complex_relation_relationship_sim: Relationship
# complex session
session_sim: Session
date_recorded_dtsim: Date recorded
year_recorded_sim: Year recorded
# complex subject
complex_subject_species_sim: Subject species
complex_subject_type_sim: Subject type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment