mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-23 20:28:06 +01:00
2e112e2406
* Add semi to ESLint rules * Add padded-blocks to ESLint rules * Add comma-dangle to ESLint rules * add config/webpack and storyboard * add streaming/ * yarn test:lint -- --fix
20 lines
614 B
JavaScript
20 lines
614 B
JavaScript
import React from 'react';
|
|
import { injectIntl, FormattedRelative } from 'react-intl';
|
|
import PropTypes from 'prop-types';
|
|
|
|
const RelativeTimestamp = ({ intl, timestamp }) => {
|
|
const date = new Date(timestamp);
|
|
|
|
return (
|
|
<time dateTime={timestamp} title={intl.formatDate(date, { hour12: false, year: 'numeric', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' })}>
|
|
<FormattedRelative value={date} />
|
|
</time>
|
|
);
|
|
};
|
|
|
|
RelativeTimestamp.propTypes = {
|
|
intl: PropTypes.object.isRequired,
|
|
timestamp: PropTypes.string.isRequired,
|
|
};
|
|
|
|
export default injectIntl(RelativeTimestamp);
|