SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 1 down vote accepted

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


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;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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