Converting Unix timestamp renders odd results
I am using the format-date
XSLT format from GitHub
and am getting some very odd results as output. I am trying to pull
the Review Date meta data and format it.
<li class="policyList__listing--nextReview">
<xsl:call-template name="format-date">
<xsl:with-param name="date" select="review-date"/>
<xsl:with-param name="mask" select="shortDate"/>
</xsl:call-template>
</li>
The results rendered are:
<li class="policyList__listing--nextReview">-0400rg.apac12e.x4000.uai0000.N-04001eVeca-0400r@2e264188</li>
I'm scratching my head.
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ryan Griffith on 29 Apr, 2015 07:33 PM
Hi,
Definitely interesting. When you have a moment, give the following a try and let me know if the result changes at all:
Please let me know if you have any questions.
Thanks!
2 Posted by jbenoit on 29 Apr, 2015 07:52 PM
Ryan,
I modified the format as you suggested, with no change.
Jered
3 Posted by Ryan Griffith on 29 Apr, 2015 07:57 PM
Thank you for checking, Jered.
When you have a moment, please attach your Format to this discussion so I can take a closer look. Also, try updating your date formatting Format to this one from our Githug repository to make sure you have the latest and greatest.
Please let me know if you have any questions.
Thanks!
4 Posted by jbenoit on 29 Apr, 2015 08:10 PM
I did update the
format-date
format, but still weird results.Full format:
Index XML
5 Posted by Ryan Griffith on 29 Apr, 2015 08:24 PM
Thank you for confirming and attaching your Format.
When you have a moment, please check your Content Preferences (**System Menu -> Preferences -> Content**) to make sure both of the Xalan extension options next to XSLT Formats are checked.
Thanks!
6 Posted by jbenoit on 30 Apr, 2015 07:09 PM
Both XSLT format checkboxes are checked and have been checked during the duration. Another data point: This format is being run in a site. I have used the
format-date
format in Global without fail.7 Posted by Ryan Griffith on 01 May, 2015 02:13 PM
Hi,
After a little bit of head scratching, I was able to figure out the issue you are seeing. In your Format, you have the following:
Note how you are passing the mask parameter. This syntax is attempting to send a node called
shortDate
into the mask, as opposed to a string. This is causing an issue when the Xalan function attempts to generate the date.To resolve the issue, you need to pass in a string, so change the line with the mask to one of the following:
Or
Please let me know if you have any questions.
Thanks!
8 Posted by jbenoit on 01 May, 2015 02:49 PM
Ryan,
You got it exactly right! Huzzah!
Thank you!
Jered
jbenoit closed this discussion on 01 May, 2015 02:49 PM.