高章伟
2023-03-28 fa01cf80171eb10c7f1b4f1764376397b714c526
1
2
3
4
5
6
7
8
9
10
11
12
13
14
({
    showDaysOnMarket : function(component) {
        var property = component.get("v.property");
        var daysOnMarket = property.Days_On_Market__c;
        var status = "green";
        if (daysOnMarket > 60) {
            status = 'red';
        } else if (daysOnMarket > 30) {
            status = 'orange'
        }
        component.set("v.status", status);
        component.set("v.formattedDateListed", new Date(property.Date_Listed__c).toLocaleString('en-US', {month: 'short', year: 'numeric', day: 'numeric'}));
    }
})