chinwagsocial/app/assets/javascripts/components/components/relative_timestamp.jsx

16 lines
316 B
React
Raw Normal View History

import {
FormattedMessage,
FormattedDate,
FormattedRelative
} from 'react-intl';
2016-11-18 02:34:36 +11:00
const RelativeTimestamp = ({ timestamp }) => {
return <FormattedRelative value={new Date(timestamp)} />;
};
2016-08-25 05:08:00 +10:00
RelativeTimestamp.propTypes = {
2016-11-18 02:34:36 +11:00
timestamp: React.PropTypes.string.isRequired
};
2016-08-25 05:08:00 +10:00
export default RelativeTimestamp;