Feedback

Last Updated

A “last updated” string displays the time a set of data has been last updated by a system.
Last update: 2:39:00 PM
1
import {LastUpdated} from '@coveord/plasma-react';
2
3
const Demo = () => <LastUpdated />;
4
export default Demo;

Props

NameTypeDefaultDescription
classNamestring
Additionnal CSS class to add on the last updated
keyKey
labelstring"Last update:"
The text displayed before the time
onDestroy() => void
A callback function executed when the component unmounts
onRender() => void
A callback function executed when the component mounts
refLegacyRef<LastUpdated>
Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref).
timeDatenew Date()
A Date representing when the component last updated
iddeprecatedstring
do not use

Examples

Specific date
Dernière modification à 1:39:00 PM
1
import {LastUpdated} from '@coveord/plasma-react';
2
3
const ONE_HOUR = 60 * 60 * 1000;
4
5
const Demo = () => {
6
const OneHourAgo = new Date(new Date().getTime() - ONE_HOUR);
7
return <LastUpdated time={OneHourAgo} label="Dernière modification à" />;
8
};
9
export default Demo;

No guidelines exist for LastUpdated yet.

Create guidelines