I've already updated my post introducing condition controls in CS2007/Chameleon, but I wanted to add a separate post to draw attention to the changes...

To better support date comparisons, all property and value comparison condition controls now support specifying "today" and "now" as the ComparisonValue along with these two additional properties:

  1. ComparisonValueAdjustment

    ComparisonValueAdjustment defines a number to be used to adjust the ComparisonValue.  This is most useful when specifying "today" or "now" for the ComparisonValue in which case the specified number of ComparisonValueAdjustmentUnits are added to "today" or "now" before processing the condition. 

    The value of ComparisonValueAdjustment is only used when the ComparisonProperty is a DateTime, int, or double value.
  2. ComparisonValueAdjustmentUnit (Minute, Hour, Day, Month, Year, Default)

    When a ComparisonValueAdjustment is specified, ComparisonValueAdjustmentUnit identifies the unit of the adjustment value.  For example, to check to see if a specific post was made within the last 24 hours, you could use:

    <CSControl:PostPropertyValueComparison runat="server" ComparisonProperty="PostDate" Operator="GreaterThan" ComparisonValue="now" ComparisonValueAdjustment="-24" ComparisonValueAdjustmentUnit="Hour" />

    When ComparisonProperty is an int or double and a ComparisonValueAdjustment is specified, the ComparisonValueAdjustmentUnit is irrelevant.  The default unit for DateTime adjustments is 'Day'.

These changes now support implementing current-date-aware conditions such as highlighting recent posts and new users.