DayJS Replacement
This commit is contained in:
@@ -4,7 +4,8 @@ import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectDates } from "../../../redux/reporting/reporting.selectors";
|
||||
import moment from "moment";
|
||||
import dayjs from '../../../util/day.js';
|
||||
|
||||
import { DateFormat } from "../../../util/constants";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
dates: selectDates,
|
||||
@@ -13,9 +14,9 @@ const mapStateToProps = createStructuredSelector({
|
||||
export function ReportingTitleAtom({ dates }) {
|
||||
return (
|
||||
<Typography.Title level={2}>
|
||||
{`RPS Report for Period from ${moment(dates.startDate).format(
|
||||
{`RPS Report for Period from ${dayjs(dates.startDate).format(
|
||||
DateFormat
|
||||
)} to ${moment(dates.endDate).format(DateFormat)}`}
|
||||
)} to ${dayjs(dates.endDate).format(DateFormat)}`}
|
||||
</Typography.Title>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Tooltip } from "antd";
|
||||
import moment from "moment";
|
||||
import dayjs from '../../../util/day.js';
|
||||
|
||||
import React, { useEffect, useState } from "react";
|
||||
|
||||
export default function TimeAgoFormatter(props) {
|
||||
const [timestampString, setTimestampString] = useState("");
|
||||
const m = moment(props.children);
|
||||
const m = dayjs(props.children);
|
||||
useEffect(() => {
|
||||
const timer = setInterval(() => setTimestampString(m.fromNow()), 15000);
|
||||
setTimestampString(m.fromNow());
|
||||
|
||||
Reference in New Issue
Block a user