A client is recording the expiry dates of staff blue cards in their SugarCRM database.
So I used the following sugar logic to show if the blue card has expired or not:
However, the problem here is that when a user of SugarCRM is editing the record, there is a known bug that means it will display “EXPIRED” regardless of if the date is in the past or future.
The workaround for this bug (thanks Anthony) is to wrap the date field in a date(toString($datefield)) bit of code, this transform the original sugar logic into this:
Which works a treat.