0

I'd like to know about ' Updated 17 minutes ago' feature how it work on lightning component. I'm making custom related list view with lightning component and I want to show latest update time as below. However I do not know how I make it manually on Aura lightning component. please let me know if anyone know this feature HIW. Thank you so much. enter image description here

0

I think you can work with lightning:relativeDateTime to show the latest update time.

<aura:component>
    <aura:attribute name="now" type="Object"/>
    <aura:handler name="init" value="{! this }" action="{! c.init }" />
    <lightning:relativeDateTime value="{! v.now }"/>
</aura:component>

Here's the client-side controller.

({
    init: function (cmp) {
        cmp.set('v.now', Date.now());
    }
 });

Source: https://developer.salesforce.com/docs/component-library/bundle/lightning:relativeDateTime/example

1
  • Thank you for your kind response. it helped me to solve this issue. Thanks a lot.
    – Chris Jang
    Jul 23 '20 at 6:22

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.