How to configure a different date format for a specific letter
- Article Type: General
- Product: Alma
Desired Outcome Goal:
Procedure:
To present a date with a specific format (e.g. YYYY-MM-DD) in a different format (e.g. DD-MM-YYYY), you configure the letter's xsl:
For the example "POLineClaimLetter", with "order date" in format YYYY-MM-DD:
1. Go to Alma>General configuration>Configuration menu>Customize letters.
2. Choose the letter you wish to customize and click Actions>Edit.
3. Revise the xsl to alter the format of the date you want to change:
a) Locate the date you wish to change in the xsl.
In our example: <strong>@@order_date@@:</strong> <xsl:value-of select="poline_date" />
(To identify the date you want to change, check the xml file. See: http://customercenter.exlibrisgroup.com/DocumentationCenter/Ex%20Libris%20Documentation/Alma/OLH/index.html#page/Administration/adm.configure_notification_template.form.xml_receiver.html)
b) Change the xsl to show the desired format.
To do this, replace the name of the date (e.g. "poline_date") with the desired formatting.
Show the parts of the date (year, month, day) in the desired order, according to their location in the default format.
Each part will consist of "substring(DATE_NAME,POSITION_IN_STRING,NUMBER_OF_DIGITS)", where:
DATE_NAME = the name of the date you're changing (e.g. poline_date)
POSITION_IN_STRING = the position of the part you are defining in the string (e.g. Month, in format YYYY-MM-DD, is in position 6)
NUMBER_OF_DIGITS = the number of digits the part you are defining consists of (Day=2, Month=2, Year=4).
<xsl:value-of select="concat(substring(Day), 'SEPERATOR', substring(Month), 'SEPERATOR', substring(Year))"/>.
In our example:
Day = substring(poline_date,6,2)
Month = substring(poline_date,9,2)
Year = substring(poline_date,1,4)
And the Seperator is '-'
Therefore, to show Day-Month-Year:
<strong>@@order_date@@:</strong> <xsl:value-of select="concat(substring(poline_date,6,2), '-', substring(poline_date,9,2), '-', substring(poline_date,1,4))"/>
This will give us 13-04-2014 instead of the Default 2014-04-13
- Article last edited: 4/13/2014