0

We have some processes that are changing on September 1st and the processes that are changing require our clients to be on two different pricing schemes.

The pricing scheme goes in affect on Sept 1st, so I'm needing to hide a line of information on a component that is for the old clients, while the new clients see the line of information.

<aura:iteration items="{!v.involvement}" var="inv">    
<aura:if isTrue="{!lessthan(inv.CreatedDate,2019-09-01)}">
    ---- Old Info ------
        <aura:set attribute="else">
        ----- New Info -----
        </aura:set>
    </aura:if>
</aura:iteration>

But this just outputs the ELSE text. How can I base the aura:if off a datetime field? Can I? I'd rather not create another formula field that detects if CreatedDate is less than 2019-09-01.

Cheers

0

1 Answer 1

1

You can compare dates with aura:if like below

Component:

Declare one aura variable to hold default value

<aura:attribute name="deadLineDate" type="date" default="2019-09-01"/>

Controller

 <aura:if  isTrue="{!(inv.CreatedDate < v.deadLineDate)}">
  ----- Old Info-----
 <aura:set attribute="else">
  ----- New Info -----
 </aura:set>
1
  • Of course! My head was too tired yesterday to think of that. Thanks!
    – DCole
    Aug 22, 2019 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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