|
@@ -23,7 +23,7 @@ const FormattedDistanceDate = (props) => {
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<span id={elemId}>{formatDistanceStrict(date, baseDate)}</span>
|
|
<span id={elemId}>{formatDistanceStrict(date, baseDate)}</span>
|
|
|
- <UncontrolledTooltip placement="bottom" fade={false} target={elemId}>{dateFormatted}</UncontrolledTooltip>
|
|
|
|
|
|
|
+ {props.isShowTooltip && <UncontrolledTooltip placement="bottom" fade={false} target={elemId}>{dateFormatted}</UncontrolledTooltip>}
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
@@ -34,9 +34,11 @@ FormattedDistanceDate.propTypes = {
|
|
|
baseDate: PropTypes.instanceOf(Date),
|
|
baseDate: PropTypes.instanceOf(Date),
|
|
|
// the number(sec) from 'baseDate' to avoid format
|
|
// the number(sec) from 'baseDate' to avoid format
|
|
|
differenceForAvoidingFormat: PropTypes.number,
|
|
differenceForAvoidingFormat: PropTypes.number,
|
|
|
|
|
+ isShowTooltip: PropTypes.bool,
|
|
|
};
|
|
};
|
|
|
FormattedDistanceDate.defaultProps = {
|
|
FormattedDistanceDate.defaultProps = {
|
|
|
differenceForAvoidingFormat: 86400 * 3,
|
|
differenceForAvoidingFormat: 86400 * 3,
|
|
|
|
|
+ isShowTooltip: true,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default FormattedDistanceDate;
|
|
export default FormattedDistanceDate;
|