Override default date display setting

19 views
Skip to first unread message

Wang, Hannah (Secretary)

unread,
Mar 3, 2026, 12:13:20 PM (2 days ago) Mar 3
to Archivesspac...@lyrasislists.org

Hi everyone,

 

I’m trying to write a plugin that will override the default date display setting in search results – right now, it defaults to the Date Expression, even if Begin and End dates are present. I would like it to default to Begin Date – End Date, since our use of Date Expression is limited to describing bulk dates and we rely much more on the Begin and End dates for browsing/searching.

 

Does anyone know where this default behavior is defined? I can see that the template frontend/app/views/dates/_show.html.erb has some conditional logic that displays the Date Expression if it exists, but this seems to only apply to the Date section in a record view, rather than the search results.

 

Any pointers would be greatly appreciated!

 

Thanks,
Hannah

 

--

Hannah Wang

Deputy Archivist for Digital Archives | U.S. Senate Historical Office

201 Hart Senate Office Building | (202) 224-3351

Joshua D. Shaw

unread,
Mar 3, 2026, 5:16:27 PM (2 days ago) Mar 3
to Archivesspac...@lyrasislists.org
Hi Hannah

This is annoyingly hard to change. The data for that field is read from the Solr index `dates` field and configured via the browse column preferences. So (in a broad, handwavy sort of way) you'd probably want to
  1. Add your custom date format field to the Solr index. Not hard to do but would require a full reindex for the objects you want to use the new format. Happy to share the code to add a custom field if that helps.
  2. Add to the browse column defaults for the various types where you want your custom date field to show up. (https://github.com/archivesspace/archivesspace/blob/master/common/config/search_browse_column_config.rb) I have not done this specifically, but I think you'd want to add a file called search_browse_column_plugin_config.rb modelled after https://github.com/archivesspace/archivesspace/blob/master/plugins/custom_browse_search_column/search_browse_column_plugin_config.rb#L1 to your plugin - overriding the date key for each object.

At Dartmouth we've completely overridden the default staff search view because we have too much data we want to display to stick with the column view and use a more list like (aka Google search) type view.

Happy to take this to email if that would be helpful!
Joshua

From: 'Wang, Hannah (Secretary)' via Archivesspace_Users_Group <Archivesspac...@lyrasislists.org>
Sent: Tuesday, March 3, 2026 12:13 PM
To: Archivesspac...@lyrasislists.org <Archivesspac...@lyrasislists.org>
Subject: [ArchivesSpace Users Group] Override default date display setting
 
--
You received this message because you are subscribed to the Google Groups "Archivesspace_Users_Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Archivesspace_User...@lyrasislists.org.
To view this discussion visit https://groups.google.com/a/lyrasislists.org/d/msgid/Archivesspace_Users_Group/6EA7FBA8-1089-44F6-B149-15329534692A%40sec.senate.gov.
Reply all
Reply to author
Forward
0 new messages