Search This Blog

Wednesday, May 26, 2010

Compare Dates in XSL of DataView webpart

The dates within XSL can not be compared directly. Following is the example how it can be done :

<xsl:if test="number(translate(substring-before(ddwrt:FormatDate(@Created,1053 ,5), ' '), '-', '')) = number(translate(substring-before(ddwrt:TodayIso(), 'T'), '-', ''))" >
< xsl:value-of select="@Title"/>
</xsl:if>

In this example @Created field(SharePoint List column) is compared with current date(TodayIso()).

No comments:

Post a Comment