mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 11:35:57 +01:00
implemented popover for annotate
This commit is contained in:
@@ -49,6 +49,7 @@ type Props = WithTranslation & {
|
||||
* ci server.
|
||||
*/
|
||||
baseDate?: DateInput;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
type Options = {
|
||||
@@ -100,13 +101,17 @@ class DateFromNow extends React.Component<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { date } = this.props;
|
||||
const { date, className } = this.props;
|
||||
if (date) {
|
||||
const isoDate = toDate(date);
|
||||
const options = this.createOptions();
|
||||
const distance = formatDistance(isoDate, this.getBaseDate(), options);
|
||||
const formatted = format(isoDate, FullDateFormat, options);
|
||||
return <DateElement title={formatted}>{distance}</DateElement>;
|
||||
return (
|
||||
<DateElement className={className} title={formatted}>
|
||||
{distance}
|
||||
</DateElement>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user