date format issue

jjohn352's Avatar

jjohn352

17 Feb, 2015 07:56 PM

Hi .... been trying to utilize the format-date.xsl but running into issues. It is not pulling the correct date in ... it somehow defaults to the current date for each "event" instance. Any help would greatly be appreciated. It formats the date correctly but it is the wrong date.

Jeff

  1. 1 Posted by Ryan Griffith on 18 Feb, 2015 04:40 PM

    Ryan Griffith's Avatar

    Hi Jeff,

    Curious, but perhaps the date formatting template is not getting the correct value, which would cause the current date to be used as a fallback.

    When you have a moment, try replacing the following line:

    <xsl:with-param name="date" select="event-start"/>
    

    To:

    <xsl:with-param name="date" select="number(event-start)"/>
    

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by jjohn352 on 18 Feb, 2015 06:00 PM

    jjohn352's Avatar

    Hi Ryan,

    Thanks for getting back to me. I made the change you suggested and to no avail. Any other ideas?

    Jeff

  3. 3 Posted by Ryan Griffith on 18 Feb, 2015 06:19 PM

    Ryan Griffith's Avatar

    Hi Jeff,

    My apologies, I did not realize the event-start and event-end were structured data fields; more specifically they are calendar fields.

    By default, the date formatting XSLT Format will expect a numeric timestamp, which is what you would see with the assets metadata (eg start date, end date, created on, etc).

    When you have a moment, make sure you have the most up-to-date format by grabbing the latest code from here. Then, try the following:

    <xsl:call-template name="format-calendar-string">
        <xsl:with-param name="date" select="string(event-start)"/>
        <xsl:with-param name="mask">longDate</xsl:with-param>
    </xsl:call-template>
    

    Please let me know if you have any questions.

    Thanks!

  4. 4 Posted by jjohn352 on 18 Feb, 2015 06:28 PM

    jjohn352's Avatar

    Hi Ryan,

    Thank you! That did the trick. You are a rock star my friend!

  5. 5 Posted by Ryan Griffith on 18 Feb, 2015 09:50 PM

    Ryan Griffith's Avatar

    Not a problem at all, Jeff, thank you for following up. I am glad to hear the updated template call did the trick.

    I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.

    Have a great day!

  6. Ryan Griffith closed this discussion on 18 Feb, 2015 09:50 PM.

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

 

26 Aug, 2016 01:19 PM
25 Aug, 2016 03:02 PM
25 Aug, 2016 12:50 PM
24 Aug, 2016 08:43 PM
24 Aug, 2016 07:20 PM
21 Aug, 2016 01:20 PM