This is a breaking change, moment is no longer with us, let us have a dayjs of silence.

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2023-12-13 19:06:15 -05:00
parent 25173b0903
commit 65157a094f
97 changed files with 772 additions and 592 deletions

View File

@@ -1,10 +1,10 @@
import { Tooltip } from "antd";
import moment from "moment";
import dayjs from "../utils/day";
import React from "react";
export function DateFormatter(props) {
return props.children
? moment(props.children).format(
? dayjs(props.children).format(
props.includeDay ? "ddd MM/DD/YYYY" : "MM/DD/YYYY"
)
: null;
@@ -12,19 +12,19 @@ export function DateFormatter(props) {
export function DateTimeFormatter(props) {
return props.children
? moment(props.children).format(
? dayjs(props.children).format(
props.format ? props.format : "MM/DD/YYYY hh:mm a"
)
: null;
}
export function TimeFormatter(props) {
return props.children
? moment(props.children).format(props.format ? props.format : "hh:mm a")
? dayjs(props.children).format(props.format ? props.format : "hh:mm a")
: null;
}
export function TimeAgoFormatter(props) {
const m = moment(props.children);
const m = dayjs(props.children);
return props.children ? (
<Tooltip placement="top" title={m.format("MM/DD/YYY hh:mm A")}>
{m.fromNow()}
@@ -33,5 +33,5 @@ export function TimeAgoFormatter(props) {
}
export function DateTimeFormat(value) {
return moment(value).format("MM/DD/YYYY hh:mm A");
return dayjs(value).format("MM/DD/YYYY hh:mm A");
}