Added time ago formatter + schema changes for BOD-198
This commit is contained in:
@@ -1,14 +1,24 @@
|
||||
import React from "react";
|
||||
import moment from "moment";
|
||||
import Moment from "react-moment";
|
||||
import { Tooltip } from "antd";
|
||||
|
||||
export function DateFormatter(props) {
|
||||
return props.children ? (
|
||||
<Moment format="MM/DD/YYYY ">{props.children}</Moment>
|
||||
) : null;
|
||||
}
|
||||
|
||||
export function DateTimeFormatter(props) {
|
||||
return props.children ? (
|
||||
<Moment format="MM/DD/YYYY @ HH:mm">{props.children}</Moment>
|
||||
) : null;
|
||||
}
|
||||
|
||||
export function TimeAgoFormatter(props) {
|
||||
const m = moment(props.children);
|
||||
return props.children ? (
|
||||
<Tooltip placement="top" title={m.format("MM/DD/YYY hh:mm A")}>
|
||||
{m.fromNow()}
|
||||
</Tooltip>
|
||||
) : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user