Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • erica 1 post 71 karma points
    Mar 19, 2018 @ 15:41
    erica
    0

    Format Date For French With "1er"

    We've been asked to format dates on our French master page with an "er" suffix if and only if the date is the first of the month ex. Le 1er Mars. We are using Umbraco version 7.5.7

    I tried creating an XSLT macro with <umbraco:Macro newsDate="[@newsDate]" Alias="FRCustomDateFormat" runat="server"></umbraco:Macro> and

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
    <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt">
    
      <xsl:output method="xml" omit-xml-declaration="yes"/>
      <xsl:variable name="newsDate" select="macro/newsDate" />
    
      <xsl:template match="*">
        <xsl:value-of select="$newsDate" />
      </xsl:template>
    </xsl:stylesheet>
    

    But this just displays nothing at all.

    I also tried creating a script within <script runat="server"> for FormatDate and pass the newsDate into it, but that didn't work either.

    How can I fulfill this request?

Please Sign in or register to post replies

Write your reply to:

Draft