You can do this with an icon rule, something like the following:
Code:
program:
d1 = raw_field('#mydate');
d2 = raw_field('pubdate');
if and(field('#mybool_test') == 'yes',
d1 != 'none',
d2 != 'none') then
if days_between(d1, d2) ># 0 then
'yes.png'
else
'no.png'
fi
else
# Don't want an icon if the conditions aren't true. The else clause can be removed
''
fi