Quantcast
Viewing all articles
Browse latest Browse all 25064

CQWP XSLT If @DueDate is past ddwrt:Today() Highlight in Red

I am working with a CQWP to roll up several Task lists. I need to display the Date in the Due Date column in RED if the date is past today's date. I have looked at several blogs and tutorials with no luck. I have found this but unable to put the code together properly to get it to work.

http://blogs.msdn.com/b/sharepointdesigner/archive/2008/02/25/filtering-and-formatting-with-date-values.aspx?PageIndex=2

I am using ddwrt:Today() to get todays date

The @DueDate is in the following format 2012-07-20 00:00:00

Here is the template I am using

<xsl:template name="Actions" match="Row[@Style='Actions']" mode="itemstyle">
		<xsl:param name="CurPos" />     
		<xsl:param name="Last" />
        <xsl:variable name="SafeLinkUrl">
            <xsl:call-template name="OuterTemplate.GetSafeLink">
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="SafeImageUrl">
            <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
                <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <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:call-template>
        </xsl:variable>
        <xsl:variable name="LinkTarget">
            <xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
        </xsl:variable>
        <xsl:variable name="tableStart">       
        	<xsl:if test="$CurPos = 1">        
        	<![CDATA[          
        	<table cellpadding="1" cellspacing="0" border="0" width="100%" id="t1" class="example table-autosort table-autofilter table-autopage:50 table-stripeclass:alternate table-page-number:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount">           
        	  <thead>
        		<tr>
				  <th class="table-filterable table-sortable:default">Title</th>
				  <th class="table-filterable table-sortable:default">Task Status</th>
				  <th class="table-filterable table-sortable:default">Assigned To</th>
				  <th class="table-filterable table-sortable:date">Due Date</th>
				  <th class="table-filterable table-sortable:default">Project ID</th>
				  <th class="table-filterable table-sortable:default">Action Assigned By</th>
				</tr> 
			  </thead>
			  <tbody>]]>        
        	</xsl:if>     
        </xsl:variable>       
        <xsl:variable name="tableEnd">       
        	<xsl:if test="$CurPos = $Last">         
        		<![CDATA[         		
        		</tbody>        		 
        		 <tfoot>
					<tr>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td class="table-page:previous" style="cursor:pointer;">&lt; &lt; Previous</td>
						<td colspan="4" style="text-align:center;">Page <span id="t1page"></span>&nbsp;of <span id="t1pages"></span></td>
						<td class="table-page:next" style="cursor:pointer;">Next &gt; &gt;</td>
					</tr>
					<tr>
						<td colspan="6"><span id="t1filtercount"></span>&nbsp;of <span id="t1allcount"></span>&nbsp;rows match filter(s)</td>
				</tfoot>
        	</table> ]]>      
        	</xsl:if>     
        </xsl:variable>
        
		<xsl:value-of select="$tableStart" disable-output-escaping="yes"/>     
		<tr>       
			<td>           
				<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>     
                <a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
                    <xsl:value-of select="substring($DisplayTitle,1,50)" disable-output-escaping="yes"/>
                </a>       
			</td>       
			<td>         
				<xsl:value-of select="@Status" />       
			</td>       
			<td>         
				<xsl:value-of select="substring-after(@AssignedTo,'#')" disable-output-escaping="yes"/>       
			</td>   
			<td>         
				<xsl:value-of select="@DueDate" />       
			</td>
			<td>         
				<xsl:value-of select="@Project_x005F_x0020_ID" />      
			</td>  
			<td>
				<xsl:value-of select="substring-after(@Action_x005F_x0020_Assigned_x005F_x0020_By,'#')" disable-output-escaping="yes" />
			</td>
		</tr>     
			<xsl:value-of select="$tableEnd" disable-output-escaping="yes"/>   
    </xsl:template>

Thanks for any help on this!



Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>