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.
1 Answer
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
-
Thank you for your kind response. it helped me to solve this issue. Thanks a lot. Jul 23, 2020 at 6:22