23 lines
572 B
JavaScript
23 lines
572 B
JavaScript
import { Tooltip } from "antd";
|
|
import moment from "moment";
|
|
import React from "react";
|
|
|
|
export function DateFormatter(props) {
|
|
return props.children ? moment(props.children).format("MM/DD/YYYY") : null;
|
|
}
|
|
|
|
export function DateTimeFormatter(props) {
|
|
return props.children
|
|
? moment(props.children).format("MM/DD/YYYY hh:mm a")
|
|
: 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;
|
|
}
|