When trying to display the start-date in the search results, the start-date is displayed as the day before, for example, thet start-date is January 1st 2015, the displayed date is Decembre 31st 2014.
I modified the file : \cms\skins\atd31\services\web\pages\services\search\hit\hit_3.3.xsl
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2012 Anyware ServicesLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<xsl:stylesheet version="1.0"
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:math="java.lang.Math"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
xmlns:resolver="org.ametys.cms.transformation.xslt.ResolveURIComponent"
xmlns:ametys="org.ametys.web.transformation.xslt.AmetysXSLTHelper"
extension-element-prefixes="math str"><xsl:import href="plugin:web://pages/services/search/hit/hit_3.3.xsl"/>
<!-- Template used to display a page -->
<xsl:template name="hit-page">
<li>
<xsl:attribute name="class">hit page<xsl:text> </xsl:text>
<xsl:call-template name="common-utils-class"/>
</xsl:attribute>
<a title="Unknown macro: {title}">
<xsl:attribute name="href">
<xsl:value-of select="ametys:absoluteSiteUriPrefix(siteName)"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="uri"/>
<xsl:text>.html</xsl:text>
<xsl:if test="/search/form/values/textfield != '' or /search/form/values/all-words != '' or /search/form/values/exact-wording != ''">
<xsl:choose>
<xsl:when test="contains(uri, '?')">&</xsl:when>
<xsl:otherwise>?</xsl:otherwise>
</xsl:choose>
<xsl:text>search-keywords=</xsl:text>
<xsl:if test="/search/form/values/textfield != ''"><xsl:value-of select="/search/form/values/textfield"/></xsl:if>
<xsl:if test="/search/form/values/all-words != ''">
<xsl:if test="/search/form/values/textfield != ''">,</xsl:if>
<xsl:for-each select="str:split(/search/form/values/all-words)">
<xsl:if test="position() > 1">,</xsl:if>
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:if>
<xsl:if test="/search/form/values/exact-wording != ''">
<xsl:if test="/search/form/values/textfield != '' or /search/form/values/all-words != ''">,</xsl:if>
<xsl:value-of select="/search/form/values/exact-wording"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
<xsl:value-of select="title"/>
</a>
<xsl:call-template name="hit-scoring"/>
<xsl:call-template name="hit-excerpt"/>
<xsl:call-template name="hit-multisite"/>
<xsl:call-template name="hit-startdate"/>
<!--<p><xsl:copy-of select='.'/></p> -->
</li>
</xsl:template><!-- Template used to display the relevance -->
<xsl:template name="hit-scoring"></xsl:template>
<xsl:template name="hit-lastvalidation"></xsl:template>
<xsl:template name="hit-startdate">
<xsl:if test="content/start-date">
<div class="service-search-startdate">Date: <i18n:date src-pattern="yyyyMMdd" pattern="long" value="Unknown macro: {content/start-date}"/></div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
In the content-view the date is ok
- depends on
-
CMS-5541 Lucene Date indexation format
- Closed