0

Is it possible to apply conditional formatting to a date column? I'm trying to set the columns background to red if the date has passed using the following

<xsl:if test="normalize-space($thisNode/@Completion_x0020_Date) >= 'Today'" ddwrt:cf_explicit="1">background-color: #71B84F;</xsl:if>

Thanks, Jason

1 Answer 1

1

I got this from a post about filtering and formatting with Date Values. At this point, the main problem is around the formatting of the comparison. This is xml so when the parser sees ">', it views as the closing bracket and not as a comparison. You need to encode this as

"&gt;=" 

for the comparison to be recognized.

<xsl:if test="number(translate(substringbefore
(@Modified_Recently$Modified_Recently_ISO,'T'), '-',''))
&gt;= number(translate(substring-before($Today,'T'),'-',''))">
background-color: #00FF00;
</xsl:if>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.