<xsl:template name="TitleDate" match="Row[@Style='TitleOnly']" mode="itemstyle">
        <xsl:variable name="SafeLinkUrl">
            <xsl:call-template name="OuterTemplate.GetSafeLink">
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
        <xsl:variable name="DisplayTitle">
            <xsl:call-template name="OuterTemplate.GetTitle">
                <xsl:with-param name="Title" select="@Title"/>
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
        <xsl:variable name="DisplayDueDate">
         <xsl:value-of select="@TaskDueDate" />
      <div class="item link-item">
        <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
        <a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
          <xsl:if test="$ItemsHaveStreams = 'True'">
            <xsl:attribute name="onclick">
              <xsl:value-of select="@OnClickForWebRendering"/>
          <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
            <xsl:attribute name="onclick">
              <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
          <xsl:value-of select="$DisplayTitle "/>
        <xsl:value-of select="$DisplayDueDate" />

I have this code that gives me the Title and Date of all tasks. My question is how would I format the date?

This is what it looks like formatted.


2014-07-30 00:00:00

Also is there a way to make this into a column instead of one under the other?



I don't know your desired output format, but an example would be:

<xsl:value-of select="ddwrt:FormatDateTime(@Created, 1033, 'MMMM d, yyyy')" />

This should still apply to 2013.

Kyle links to some useful resources in this post, like MSDN and Heather Solomon.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.