<?xml version="1.0" encoding="UTF-8"?>
<!-- Template to make the iso8601 date -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://xml.apache.org/xalan/java">
<xsl:template name="get_ISO8601_date">
<xsl:param name="date"/>
<xsl:param name="pid">not provided</xsl:param>
<xsl:param name="datastream">not provided</xsl:param>
<xsl:value-of select="java:ca.discoverygarden.gsearch_extensions.JodaAdapter.transformForSolr($date, $pid, $datastream)"/>
</xsl:template>
</xsl:stylesheet>
<copyField source="mods_titleInfo_partNumber_ms" dest="mods_titleInfo_partNumber_int"/>
<field name="mods_titleInfo_partNumber_int" type="int" indexed="true" stored="true" multiValued="false"/>
'date_format' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'The date format used for dates.',
),
islandora_solr_metadata_fields" table, where I found the following field, note, and data:
`date_format` varchar(255) DEFAULT NULL COMMENT 'The PHP date format used for dates.',
`islandora_solr_metadata_fields` (`configuration_id`, `solr_field`, `display_label`, `hyperlink`, `weight`, `permissions`, `date_format`, `structured_data`)
(7, 'mods_originInfo_encoding_w3cdtf_qualifier_approximate_dateCreated_dt', 'qualifier_approximate BRAD', 0, 28, NULL, NULL, NULL),
I saw that `date_format` was NULL, so just for the heck of it, edited the field and used 'Y-m-d' as the value.
Said a prayer, hit reload, but no joy...
In summary, it seems islandora_solr_metadata module has the beginnings of a strategy to convert SOLR's millisecond based Epoch time to a user-defined, PHP style date() format, but I could find no function in it's code to utilize the `date_format` field.
It's a really, truly, beautiful idea however, to be able to define the date format output on a per field basis from within islandora_solr_metadata.
Next step was to review islandora_solr_metadata's jira for any similar issues. Found:
https://jira.duraspace.org/browse/ISLANDORA-978
Please login to jira and vote for this issue :-)
I've done a lot of date conversion programming before, seems like a great opportunity for me to give something back to Islandora... Hmmmmmm... No promises, but that's where my heart is right now.
if (is_numeric($value) && (int)$value == $value ) {
return format_date($value, 'custom', $date_format[$field], 'UTC'); //Use the unix time stamp directly
}
else{
return format_date(strtotime($value), 'custom', $date_format[$field], 'UTC'); //Do as we are doing right now
}
`date_format` field within the `islandora_solr_metadata_fields` table is completely different than the date_format() function found elsewhere.--
For more information about using this group, please read our Listserv Guidelines: http://islandora.ca/content/welcome-islandora-listserv
---
You received this message because you are subscribed to the Google Groups "islandora" group.
To unsubscribe from this group and stop receiving emails from it, send an email to islandora+...@googlegroups.com.
What exactly are you looking for?
- Adam