e.stopPropagation()}
- value={(record[field] && moment(record[field])) || null}
+ value={(record[field] && dayjs(record[field])) || null}
onChange={handleChange}
minuteStep={15}
format="hh:mm a"
diff --git a/client/src/components/production-list-columns/production-list-columns.lastcontacted.component.jsx b/client/src/components/production-list-columns/production-list-columns.lastcontacted.component.jsx
index 6f4bd5668..382ace0e4 100644
--- a/client/src/components/production-list-columns/production-list-columns.lastcontacted.component.jsx
+++ b/client/src/components/production-list-columns/production-list-columns.lastcontacted.component.jsx
@@ -1,6 +1,6 @@
import { useMutation } from "@apollo/client";
import { Button, Card, Dropdown, Form, Input, notification, Space } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useState, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -84,7 +84,7 @@ export function ProductionLastContacted({ currentUser, record }) {
form.setFieldsValue({
note: null,
date_last_contacted:
- record.date_last_contacted && moment(record.date_last_contacted),
+ record.date_last_contacted && dayjs(record.date_last_contacted),
});
}
}, [visible, form, record.date_last_contacted]);
diff --git a/client/src/components/production-list-columns/prodution-list-columns.touchtime.component.jsx b/client/src/components/production-list-columns/prodution-list-columns.touchtime.component.jsx
index c651b7f8d..c6ff374e7 100644
--- a/client/src/components/production-list-columns/prodution-list-columns.touchtime.component.jsx
+++ b/client/src/components/production-list-columns/prodution-list-columns.touchtime.component.jsx
@@ -1,4 +1,4 @@
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useMemo } from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -21,8 +21,8 @@ export function ProductionlistColumnTouchTime({ bodyshop, job }) {
(job.larhrs.aggregate.sum.mod_lb_hrs || 0) +
(job.labhrs.aggregate.sum.mod_lb_hrs || 0);
- const Difference_In_Days = moment().diff(
- moment(job.actual_in),
+ const Difference_In_Days = dayjs().diff(
+ dayjs(job.actual_in),
"days",
true
);
diff --git a/client/src/components/report-center-modal/report-center-modal.component.jsx b/client/src/components/report-center-modal/report-center-modal.component.jsx
index 913d27282..d32be9e72 100644
--- a/client/src/components/report-center-modal/report-center-modal.component.jsx
+++ b/client/src/components/report-center-modal/report-center-modal.component.jsx
@@ -11,7 +11,7 @@ import {
Typography,
} from "antd";
import _ from "lodash";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -77,13 +77,13 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
name: values.key,
variables: {
...(start
- ? { start: moment(start).startOf("day").format("YYYY-MM-DD") }
+ ? { start: dayjs(start).startOf("day").format("YYYY-MM-DD") }
: {}),
...(end
- ? { end: moment(end).endOf("day").format("YYYY-MM-DD") }
+ ? { end: dayjs(end).endOf("day").format("YYYY-MM-DD") }
: {}),
- ...(start ? { starttz: moment(start).startOf("day") } : {}),
- ...(end ? { endtz: moment(end).endOf("day") } : {}),
+ ...(start ? { starttz: dayjs(start).startOf("day") } : {}),
+ ...(end ? { endtz: dayjs(end).endOf("day") } : {}),
...(id ? { id: id } : {}),
},
diff --git a/client/src/components/schedule-block-day/schedule-block-day.component.jsx b/client/src/components/schedule-block-day/schedule-block-day.component.jsx
index 548da1f9f..9bbc76c28 100644
--- a/client/src/components/schedule-block-day/schedule-block-day.component.jsx
+++ b/client/src/components/schedule-block-day/schedule-block-day.component.jsx
@@ -1,6 +1,6 @@
import { useMutation } from "@apollo/client";
import { Dropdown, Menu, notification } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -34,8 +34,8 @@ export function ScheduleBlockDay({
block: true,
isintake: false,
bodyshopid: bodyshop.id,
- start: moment(date).startOf("day"),
- end: moment(date).endOf("day"),
+ start: dayjs(date).startOf("day"),
+ end: dayjs(date).endOf("day"),
};
logImEXEvent("dashboard_change_layout");
diff --git a/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js b/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js
index 732bcc2c2..cfd09aec3 100644
--- a/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js
+++ b/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js
@@ -1,7 +1,8 @@
import Icon from "@ant-design/icons";
import { Popover } from "antd";
import _ from "lodash";
-import moment from "moment";
+import dayjs from "../../utils/day";
+
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { MdFileDownload, MdFileUpload } from "react-icons/md";
@@ -43,7 +44,7 @@ export function ScheduleCalendarHeaderComponent({
(e) =>
!e.vacation &&
e.isintake &&
- moment(date).isSame(moment(e.start), "day")
+ dayjs(date).isSame(dayjs(e.start), "day")
),
"job.alt_transport"
);
@@ -54,7 +55,7 @@ export function ScheduleCalendarHeaderComponent({
return (
events &&
events.filter(
- (e) => moment(date).isSame(moment(e.start), "day") && e.block
+ (e) => dayjs(date).isSame(dayjs(e.start), "day") && e.block
)
);
}, [events, date]);
@@ -170,7 +171,7 @@ export function ScheduleCalendarHeaderComponent({
const isShopOpen = (date) => {
let day;
- switch (moment(date).day()) {
+ switch (dayjs(date).day()) {
case 0:
day = "sunday";
break;
diff --git a/client/src/components/schedule-calendar-wrapper/schedule-calendar-util.js b/client/src/components/schedule-calendar-wrapper/schedule-calendar-util.js
index e03b48ba0..1f2fbadea 100644
--- a/client/src/components/schedule-calendar-wrapper/schedule-calendar-util.js
+++ b/client/src/components/schedule-calendar-wrapper/schedule-calendar-util.js
@@ -1,28 +1,28 @@
-import moment from "moment";
+import dayjs from "../../utils/day";
export function getRange(dateParam, viewParam) {
let start, end;
let date = dateParam || new Date();
let view = viewParam || "week";
- // if view is day: from moment(date).startOf('day') to moment(date).endOf('day');
+ // if view is day: from dayjs(date).startOf('day') to dayjs(date).endOf('day');
if (view === "day") {
- start = moment(date).startOf("day");
- end = moment(date).endOf("day");
+ start = dayjs(date).startOf("day");
+ end = dayjs(date).endOf("day");
}
- // if view is week: from moment(date).startOf('isoWeek') to moment(date).endOf('isoWeek');
+ // if view is week: from dayjs(date).startOf('isoWeek') to dayjs(date).endOf('isoWeek');
else if (view === "week") {
- start = moment(date).startOf("week");
- end = moment(date).endOf("week");
+ start = dayjs(date).startOf("week");
+ end = dayjs(date).endOf("week");
}
- //if view is month: from moment(date).startOf('month').subtract(7, 'days') to moment(date).endOf('month').add(7, 'days'); i do additional 7 days math because you can see adjacent weeks on month view (that is the way how i generate my recurrent events for the Big Calendar, but if you need only start-end of month - just remove that math);
+ //if view is month: from dayjs(date).startOf('month').subtract(7, 'days') to dayjs(date).endOf('month').add(7, 'days'); i do additional 7 days math because you can see adjacent weeks on month view (that is the way how i generate my recurrent events for the Big Calendar, but if you need only start-end of month - just remove that math);
else if (view === "month") {
- start = moment(date).startOf("month").subtract(7, "days");
- end = moment(date).endOf("month").add(7, "days");
+ start = dayjs(date).startOf("month").subtract(7, "days");
+ end = dayjs(date).endOf("month").add(7, "days");
}
- // if view is agenda: from moment(date).startOf('day') to moment(date).endOf('day').add(1, 'month');
+ // if view is agenda: from dayjs(date).startOf('day') to dayjs(date).endOf('day').add(1, 'month');
else if (view === "agenda") {
- start = moment(date).startOf("day");
- end = moment(date).endOf("day").add(1, "month");
+ start = dayjs(date).startOf("day");
+ end = dayjs(date).endOf("day").add(1, "month");
}
return { start, end };
diff --git a/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx b/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx
index ebcccc3fa..298b2eae8 100644
--- a/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx
+++ b/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx
@@ -1,7 +1,7 @@
-import moment from "moment";
+import dayjs from "../../utils/day";
import queryString from "query-string";
import React from "react";
-import { Calendar, momentLocalizer } from "react-big-calendar";
+import { Calendar, dayjsLocalizer } from "react-big-calendar";
import { connect } from "react-redux";
import { useNavigate, useLocation } from "react-router-dom";
import { createStructuredSelector } from "reselect";
@@ -19,7 +19,7 @@ const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
problemJobs: selectProblemJobs,
});
-const localizer = momentLocalizer(moment);
+const localizer = dayjsLocalizer(dayjs);
export function ScheduleCalendarWrapperComponent({
bodyshop,
problemJobs,
@@ -49,7 +49,7 @@ export function ScheduleCalendarWrapperComponent({
};
};
- const selectedDate = new Date(date || moment(search.date) || Date.now());
+ const selectedDate = new Date(date || dayjs(search.date) || Date.now());
return (
<>
diff --git a/client/src/components/schedule-calendar/schedule-calendar.container.jsx b/client/src/components/schedule-calendar/schedule-calendar.container.jsx
index 27e05258a..8c2f90868 100644
--- a/client/src/components/schedule-calendar/schedule-calendar.container.jsx
+++ b/client/src/components/schedule-calendar/schedule-calendar.container.jsx
@@ -10,7 +10,7 @@ import ScheduleCalendarComponent from "./schedule-calendar.component";
import { calculateScheduleLoad } from "../../redux/application/application.actions";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
-import moment from "moment";
+import dayjs from "../../utils/day";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
});
@@ -63,8 +63,8 @@ export function ScheduleCalendarContainer({ calculateScheduleLoad }) {
(e.employee.first_name && e.employee.first_name.substr(0, 1)) || ""
} ${e.employee.last_name || ""} OUT`,
color: "red",
- start: moment(e.start).startOf("day").toDate(),
- end: moment(e.end).startOf("day").toDate(),
+ start: dayjs(e.start).startOf("day").toDate(),
+ end: dayjs(e.end).startOf("day").toDate(),
allDay: true,
vacation: true,
};
diff --git a/client/src/components/schedule-day-view/schedule-day-view.container.jsx b/client/src/components/schedule-day-view/schedule-day-view.container.jsx
index e35b44873..0f69a6e40 100644
--- a/client/src/components/schedule-day-view/schedule-day-view.container.jsx
+++ b/client/src/components/schedule-day-view/schedule-day-view.container.jsx
@@ -3,18 +3,18 @@ import ScheduleDayViewComponent from "./schedule-day-view.component";
import { useQuery } from "@apollo/client";
import { QUERY_APPOINTMENT_BY_DATE } from "../../graphql/appointments.queries";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
-import moment from "moment";
+import dayjs from "../../utils/day";
import { useTranslation } from "react-i18next";
export default function ScheduleDayViewContainer({ day }) {
const { loading, error, data } = useQuery(QUERY_APPOINTMENT_BY_DATE, {
variables: {
- start: moment(day).startOf("day"),
- end: moment(day).endOf("day"),
- startd: moment(day).startOf("day").format("YYYY-MM-DD"),
- endd: moment(day).add(1, "day").format("YYYY-MM-DD"),
+ start: dayjs(day).startOf("day"),
+ end: dayjs(day).endOf("day"),
+ startd: dayjs(day).startOf("day").format("YYYY-MM-DD"),
+ endd: dayjs(day).add(1, "day").format("YYYY-MM-DD"),
},
- skip: !moment(day).isValid(),
+ skip: !dayjs(day).isValid(),
fetchPolicy: "network-only",
nextFetchPolicy: "network-only",
});
@@ -43,8 +43,8 @@ export default function ScheduleDayViewContainer({ day }) {
(e.employee.first_name && e.employee.first_name.substr(0, 1)) || ""
} ${e.employee.last_name || ""} OUT`,
color: "red",
- start: moment(e.start).startOf("day").toDate(),
- end: moment(e.end).startOf("day").toDate(),
+ start: dayjs(e.start).startOf("day").toDate(),
+ end: dayjs(e.end).startOf("day").toDate(),
vacation: true,
};
}),
diff --git a/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx b/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx
index fdfb9932c..1e60264ff 100644
--- a/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx
+++ b/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx
@@ -10,7 +10,7 @@ import {
Typography,
} from "antd";
import axios from "axios";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -68,7 +68,7 @@ export function ScheduleJobModalComponent({
if (values.start && !values.scheduled_completion)
form.setFieldsValue({
- scheduled_completion: moment(values.start).businessAdd(
+ scheduled_completion: dayjs(values.start).businessAdd(
totalHours / bodyshop.target_touchtime,
"days"
),
@@ -134,11 +134,11 @@ export function ScheduleJobModalComponent({
className="imex-flex-row__margin"
key={idx}
onClick={() => {
- const ssDate = moment(d);
- if (ssDate.isBefore(moment())) {
- form.setFieldsValue({ start: moment() });
+ const ssDate = dayjs(d);
+ if (ssDate.isBefore(dayjs())) {
+ form.setFieldsValue({ start: dayjs() });
} else {
- form.setFieldsValue({ start: moment(d).add(8, "hours") });
+ form.setFieldsValue({ start: dayjs(d).add(8, "hours") });
}
handleDateBlur();
}}
@@ -201,7 +201,7 @@ export function ScheduleJobModalComponent({
{() => {
const values = form.getFieldsValue();
if (values.start) {
- calculateScheduleLoad(moment(values.start).add(3, "days"));
+ calculateScheduleLoad(dayjs(values.start).add(3, "days"));
}
return (
diff --git a/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx b/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx
index 3df5cf555..b62b1d1c6 100644
--- a/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx
+++ b/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx
@@ -1,7 +1,6 @@
import { useMutation, useQuery } from "@apollo/client";
-//import moment from "moment";
import { Form, Modal, notification } from "antd";
-import moment from "moment-business-days";
+import dayjs from "../../utils/day";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -129,8 +128,8 @@ export function ScheduleJobModalContainer({
app: {
jobid: jobId,
bodyshopid: bodyshop.id,
- start: moment(values.start),
- end: moment(values.start).add(bodyshop.appt_length || 60, "minutes"),
+ start: dayjs(values.start),
+ end: dayjs(values.start).add(bodyshop.appt_length || 60, "minutes"),
color: values.color,
note: values.note,
created_by: currentUser.email,
diff --git a/client/src/components/schedule-manual-event/schedule-manual-event.component.jsx b/client/src/components/schedule-manual-event/schedule-manual-event.component.jsx
index c0b7ba54b..fea8a4f96 100644
--- a/client/src/components/schedule-manual-event/schedule-manual-event.component.jsx
+++ b/client/src/components/schedule-manual-event/schedule-manual-event.component.jsx
@@ -1,6 +1,6 @@
import { useMutation } from "@apollo/client";
import { Button, Card, Form, Input, Popover, Select, Space } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -111,7 +111,7 @@ export function ScheduleManualEvent({ bodyshop, event }) {
async validator(rule, value) {
if (value) {
const { start } = form.getFieldsValue();
- if (moment(start).isAfter(moment(value))) {
+ if (dayjs(start).isAfter(dayjs(value))) {
return Promise.reject(
t("employees.labels.endmustbeafterstart")
);
diff --git a/client/src/components/schedule-verify-integrity/schedule-verify-integrity.component.jsx b/client/src/components/schedule-verify-integrity/schedule-verify-integrity.component.jsx
index 061b15b2c..6e390d09f 100644
--- a/client/src/components/schedule-verify-integrity/schedule-verify-integrity.component.jsx
+++ b/client/src/components/schedule-verify-integrity/schedule-verify-integrity.component.jsx
@@ -1,6 +1,6 @@
import { useApolloClient } from "@apollo/client";
import { Button } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useState } from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -27,7 +27,7 @@ export function ScheduleVerifyIntegrity({ currentUser }) {
data: { arrJobs, compJobs, prodJobs },
} = await client.query({
query: QUERY_SCHEDULE_LOAD_DATA,
- variables: { start: moment(), end: moment().add(180, "days") },
+ variables: { start: dayjs(), end: dayjs().add(180, "days") },
});
//check that the leaving jobs are either in the arriving list, or in production.
diff --git a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx
index 4e9aa85d0..3660680dc 100644
--- a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx
+++ b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx
@@ -1,7 +1,7 @@
import { Card } from "antd";
import Dinero from "dinero.js";
import _ from "lodash";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React from "react";
import { connect } from "react-redux";
import {
@@ -61,7 +61,7 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) {
}
const theValue = {
- date: moment(val).format("D ddd"),
+ date: dayjs(val).format("D ddd"),
paintHrs: _.round(dayhrs.painthrs, 1),
bodyHrs: _.round(dayhrs.bodyhrs, 1),
accTargetHrs: _.round(
diff --git a/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx b/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx
index cfd6d945d..3e4626027 100644
--- a/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx
+++ b/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx
@@ -1,5 +1,5 @@
import { Card, Divider, Statistic } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -27,7 +27,7 @@ export function ScoreboardDayStats({ bodyshop, date, entries }) {
return (
diff --git a/client/src/components/scoreboard-display/scoreboard-display.component.jsx b/client/src/components/scoreboard-display/scoreboard-display.component.jsx
index a27b5c633..02339eebf 100644
--- a/client/src/components/scoreboard-display/scoreboard-display.component.jsx
+++ b/client/src/components/scoreboard-display/scoreboard-display.component.jsx
@@ -7,7 +7,7 @@ import ScoreboardTargetsTable from "../scoreboard-targets-table/scoreboard-targe
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
-import moment from "moment";
+import dayjs from "../../utils/day";
import { useApolloClient, useQuery } from "@apollo/client";
import {
GET_BLOCKED_DAYS,
@@ -28,8 +28,8 @@ export default connect(
export function ScoreboardDisplayComponent({ bodyshop }) {
const scoreboardSubscription = useQuery(QUERY_SCOREBOARD, {
variables: {
- start: moment().startOf("month"),
- end: moment().endOf("month"),
+ start: dayjs().startOf("month"),
+ end: dayjs().endOf("month"),
},
pollInterval: 60000,
});
@@ -50,26 +50,26 @@ export function ScoreboardDisplayComponent({ bodyshop }) {
useEffect(() => {
//Update the locals.
- async function setMomentSettings() {
+ async function setDayJSSettings() {
let appointments;
if (!bodyshop.scoreboard_target.ignoreblockeddays) {
const { data } = await client.query({
query: GET_BLOCKED_DAYS,
variables: {
- start: moment().startOf("month"),
- end: moment().endOf("month"),
+ start: dayjs().startOf("month"),
+ end: dayjs().endOf("month"),
},
});
appointments = data.appointments;
}
- moment.updateLocale("ca", {
+ dayjs.updateLocale("ca", {
workingWeekdays: translateSettingsToWorkingDays(bodyshop.workingdays),
...(appointments
? {
holidays: appointments.map((h) =>
- moment(h.start).format("MM-DD-YYYY")
+ dayjs(h.start).format("MM-DD-YYYY")
),
}
: {}),
@@ -77,7 +77,7 @@ export function ScoreboardDisplayComponent({ bodyshop }) {
});
}
- setMomentSettings();
+ setDayJSSettings();
}, [client, bodyshop]);
return (
diff --git a/client/src/components/scoreboard-last-days/scoreboard-last-days.component.jsx b/client/src/components/scoreboard-last-days/scoreboard-last-days.component.jsx
index f88b897ef..e3c25b028 100644
--- a/client/src/components/scoreboard-last-days/scoreboard-last-days.component.jsx
+++ b/client/src/components/scoreboard-last-days/scoreboard-last-days.component.jsx
@@ -2,7 +2,7 @@ import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
-import moment from "moment";
+import dayjs from "../../utils/day";
import ScoreboardDayStat from "../scoreboard-day-stats/scoreboard-day-stats.component";
import { Row, Col } from "antd";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
@@ -15,11 +15,12 @@ const mapDispatchToProps = (dispatch) => ({
});
export function ScoreboardLastDays({ bodyshop, sbEntriesByDate }) {
+
const { lastNumberWorkingDays } = bodyshop.scoreboard_target;
const ArrayOfDate = [];
for (var i = lastNumberWorkingDays - 1; i >= 0; i--) {
- ArrayOfDate.push(moment().businessSubtract(i, "day").format("yyyy-MM-DD"));
+ ArrayOfDate.push(dayjs().businessDaysSubtract(i, "day").format("yyyy-MM-DD"));
}
return (
diff --git a/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx b/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx
index 112d441f6..40123a375 100644
--- a/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx
+++ b/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx
@@ -1,7 +1,7 @@
import { CalendarOutlined } from "@ant-design/icons";
import { Card, Col, Divider, Row, Statistic } from "antd";
import _ from "lodash";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -35,7 +35,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
toDatePaint: 0,
};
- const today = moment();
+ const today = dayjs();
if (dateHash[today.format("YYYY-MM-DD")]) {
dateHash[today.format("YYYY-MM-DD")].forEach((d) => {
ret.todayBody = ret.todayBody + d.bodyhrs;
@@ -43,7 +43,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
});
}
- let StartOfWeek = moment().startOf("week");
+ let StartOfWeek = dayjs().startOf("week");
while (StartOfWeek.isSameOrBefore(today)) {
if (dateHash[StartOfWeek.format("YYYY-MM-DD")]) {
dateHash[StartOfWeek.format("YYYY-MM-DD")].forEach((d) => {
@@ -54,7 +54,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
StartOfWeek = StartOfWeek.add(1, "day");
}
- let startOfMonth = moment().startOf("month");
+ let startOfMonth = dayjs().startOf("month");
while (startOfMonth.isSameOrBefore(today)) {
if (dateHash[startOfMonth.format("YYYY-MM-DD")]) {
dateHash[startOfMonth.format("YYYY-MM-DD")].forEach((d) => {
diff --git a/client/src/components/scoreboard-targets-table/scoreboard-targets-table.util.js b/client/src/components/scoreboard-targets-table/scoreboard-targets-table.util.js
index c69493108..8acfae1e5 100644
--- a/client/src/components/scoreboard-targets-table/scoreboard-targets-table.util.js
+++ b/client/src/components/scoreboard-targets-table/scoreboard-targets-table.util.js
@@ -1,31 +1,31 @@
-import moment from "moment-business-days";
+import dayjs from "../../utils/day";
-// moment.updateLocale("ca", {
+// dayjs.updateLocale("ca", {
// workingWeekdays: [1, 2, 3, 4, 5, 6],
// });
export const CalculateWorkingDaysThisMonth = () => {
- return moment().endOf("month").businessDaysIntoMonth();
+ return dayjs().endOf("month").businessDaysInMonth();
};
export const CalculateWorkingDaysInPeriod = (start, end) => {
- return moment(start).businessDiff(moment(end));
+ return dayjs(start).businessDiff(dayjs(end));
};
export const CalculateWorkingDaysAsOfToday = () => {
- return moment().businessDaysIntoMonth();
+ return dayjs().businessDaysInMonth();
};
export const CalculateWorkingDaysLastMonth = () => {
- return moment().subtract(1, "month").endOf("month").businessDaysIntoMonth();
+ return dayjs().subtract(1, "month").endOf("month").businessDaysInMonth();
};
export const WeeklyTargetHrs = (dailyTargetHrs, bodyshop) => {
return (
dailyTargetHrs *
CalculateWorkingDaysInPeriod(
- moment().startOf("week"),
- moment().endOf("week")
+ dayjs().startOf("week"),
+ dayjs().endOf("week")
)
);
};
@@ -53,20 +53,22 @@ export const AsOfTodayTargetHrs = (dailyTargetHrs, bodyshop) => {
export const AsOfDateTargetHours = (dailyTargetHours, date) => {
return (
- dailyTargetHours * moment().startOf("month").businessDiff(moment(date))
+ dailyTargetHours * dayjs().startOf("month").businessDiff(dayjs(date))
);
};
export const ListOfBusinessDaysInCurrentMonth = () => {
- const momentListOfDays = moment().monthBusinessDays();
+ // TODO This is probably broken :/
+ console.log('Hit!!!!')
+ const momentListOfDays = dayjs().businessDaysInMonth();
return momentListOfDays.map((i) => i.format("YYYY-MM-DD"));
};
export const ListOfDaysInCurrentMonth = () => {
const days = [];
- const dateStart = moment().startOf("month");
- const dateEnd = moment().endOf("month");
+ const dateStart = dayjs().startOf("month");
+ const dateEnd = dayjs().endOf("month");
while (dateEnd.diff(dateStart, "days") > 0) {
days.push(dateStart.format("YYYY-MM-DD"));
dateStart.add(1, "days");
@@ -77,8 +79,8 @@ export const ListOfDaysInCurrentMonth = () => {
export const ListDaysBetween = ({ start, end }) => {
const days = [];
- const dateStart = moment(start);
- const dateEnd = moment(end);
+ const dateStart = dayjs(start);
+ const dateEnd = dayjs(end);
while (dateEnd.diff(dateStart, "days") > 0) {
days.push(dateStart.format("YYYY-MM-DD"));
dateStart.add(1, "days");
diff --git a/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.component.jsx b/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.component.jsx
index 0117279d5..10f3a669b 100644
--- a/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.component.jsx
+++ b/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.component.jsx
@@ -1,7 +1,7 @@
import { useQuery } from "@apollo/client";
import { Col, Row } from "antd";
import _ from "lodash";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -29,24 +29,24 @@ export default connect(
export function ScoreboardTimeTicketsStats({ bodyshop }) {
const { t } = useTranslation();
- const startDate = moment().startOf("month")
- const endDate = moment().endOf("month");
+ const startDate = dayjs().startOf("month")
+ const endDate = dayjs().endOf("month");
const fixedPeriods = useMemo(() => {
- const endOfThisMonth = moment().endOf("month");
- const startofthisMonth = moment().startOf("month");
+ const endOfThisMonth = dayjs().endOf("month");
+ const startofthisMonth = dayjs().startOf("month");
- const endOfLastmonth = moment().subtract(1, "month").endOf("month");
- const startOfLastmonth = moment().subtract(1, "month").startOf("month");
+ const endOfLastmonth = dayjs().subtract(1, "month").endOf("month");
+ const startOfLastmonth = dayjs().subtract(1, "month").startOf("month");
- const endOfThisWeek = moment().endOf("week");
- const startOfThisWeek = moment().startOf("week");
+ const endOfThisWeek = dayjs().endOf("week");
+ const startOfThisWeek = dayjs().startOf("week");
- const endOfLastWeek = moment().subtract(1, "week").endOf("week");
- const startOfLastWeek = moment().subtract(1, "week").startOf("week");
+ const endOfLastWeek = dayjs().subtract(1, "week").endOf("week");
+ const startOfLastWeek = dayjs().subtract(1, "week").startOf("week");
- const endOfPriorWeek = moment().subtract(2, "week").endOf("week");
- const startOfPriorWeek = moment().subtract(2, "week").startOf("week");
+ const endOfPriorWeek = dayjs().subtract(2, "week").endOf("week");
+ const startOfPriorWeek = dayjs().subtract(2, "week").startOf("week");
const allDates = [
endOfThisMonth,
@@ -60,8 +60,8 @@ export function ScoreboardTimeTicketsStats({ bodyshop }) {
endOfPriorWeek,
startOfPriorWeek,
];
- const start = moment.min(allDates);
- const end = moment.max(allDates);
+ const start = dayjs.min(allDates);
+ const end = dayjs.max(allDates);
return {
start,
end,
@@ -155,7 +155,7 @@ export function ScoreboardTimeTicketsStats({ bodyshop }) {
};
data.fixedperiod.forEach((ticket) => {
- const ticketDate = moment(ticket.date);
+ const ticketDate = dayjs(ticket.date);
if (
ticketDate.isBetween(
fixedPeriods.startOfThisWeek,
@@ -172,24 +172,24 @@ export function ScoreboardTimeTicketsStats({ bodyshop }) {
//Seperate out to Day of Week
ret.seperatedThisWeek[
- moment(ticket.date).format("dddd").toLowerCase()
+ dayjs(ticket.date).format("dddd").toLowerCase()
].total =
ret.seperatedThisWeek[
- moment(ticket.date).format("dddd").toLowerCase()
+ dayjs(ticket.date).format("dddd").toLowerCase()
].total + ticket.productivehrs;
if (ticket.ciecacode !== "LAR")
ret.seperatedThisWeek[
- moment(ticket.date).format("dddd").toLowerCase()
+ dayjs(ticket.date).format("dddd").toLowerCase()
].lab =
ret.seperatedThisWeek[
- moment(ticket.date).format("dddd").toLowerCase()
+ dayjs(ticket.date).format("dddd").toLowerCase()
].lab + ticket.productivehrs;
if (ticket.ciecacode === "LAR")
ret.seperatedThisWeek[
- moment(ticket.date).format("dddd").toLowerCase()
+ dayjs(ticket.date).format("dddd").toLowerCase()
].lar =
ret.seperatedThisWeek[
- moment(ticket.date).format("dddd").toLowerCase()
+ dayjs(ticket.date).format("dddd").toLowerCase()
].lar + ticket.productivehrs;
} else if (
ticketDate.isBetween(
@@ -280,7 +280,7 @@ export function ScoreboardTimeTicketsStats({ bodyshop }) {
listOfDays.forEach((day) => {
const r = {
- date: moment(day).format("MM/DD"),
+ date: dayjs(day).format("MM/DD"),
actualhrs: 0,
productivehrs: 0,
};
diff --git a/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.stats.component.jsx b/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.stats.component.jsx
index 016bd137e..d0a2b9ea1 100644
--- a/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.stats.component.jsx
+++ b/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.stats.component.jsx
@@ -8,7 +8,7 @@ import {
Switch,
Typography,
} from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -49,8 +49,8 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
const statisticWeight = isLarge ? 550 : "normal";
const daySpan =
Util.CalculateWorkingDaysInPeriod(
- moment().startOf("week"),
- moment().endOf("week")
+ dayjs().startOf("week"),
+ dayjs().endOf("week")
) > 5
? 3
: 4;
@@ -170,14 +170,14 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
parseFloat(data.totalThisWeek) >=
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().startOf("week"),
- moment().endOf("week"),
+ dayjs().startOf("week"),
+ dayjs().endOf("week"),
bodyshop
) +
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyPaintTarget,
- moment().startOf("week"),
- moment().endOf("week"),
+ dayjs().startOf("week"),
+ dayjs().endOf("week"),
bodyshop
)
? "green"
@@ -202,8 +202,8 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
parseFloat(data.totalThisWeekLAB) >=
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().startOf("week"),
- moment().endOf("week"),
+ dayjs().startOf("week"),
+ dayjs().endOf("week"),
bodyshop
)
? "green"
@@ -226,8 +226,8 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
parseFloat(data.totalThisWeekLAR) >=
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyPaintTarget,
- moment().startOf("week"),
- moment().endOf("week"),
+ dayjs().startOf("week"),
+ dayjs().endOf("week"),
bodyshop
)
? "green"
@@ -252,14 +252,14 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
parseFloat(data.totalLastWeek) >=
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().subtract(1, "week").startOf("week"),
- moment().subtract(1, "week").endOf("week"),
+ dayjs().subtract(1, "week").startOf("week"),
+ dayjs().subtract(1, "week").endOf("week"),
bodyshop
) +
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyPaintTarget,
- moment().subtract(1, "week").startOf("week"),
- moment().subtract(1, "week").endOf("week"),
+ dayjs().subtract(1, "week").startOf("week"),
+ dayjs().subtract(1, "week").endOf("week"),
bodyshop
)
? "green"
@@ -284,8 +284,8 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
parseFloat(data.totalLastWeekLAB) >=
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().subtract(1, "week").startOf("week"),
- moment().subtract(1, "week").endOf("week"),
+ dayjs().subtract(1, "week").startOf("week"),
+ dayjs().subtract(1, "week").endOf("week"),
bodyshop
)
? "green"
@@ -308,8 +308,8 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
parseFloat(data.totalLastWeekLAR) >=
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyPaintTarget,
- moment().subtract(1, "week").startOf("week"),
- moment().subtract(1, "week").endOf("week"),
+ dayjs().subtract(1, "week").startOf("week"),
+ dayjs().subtract(1, "week").endOf("week"),
bodyshop
)
? "green"
@@ -334,14 +334,14 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
parseFloat(data.totalPriorWeek) >=
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().subtract(2, "week").startOf("week"),
- moment().subtract(2, "week").endOf("week"),
+ dayjs().subtract(2, "week").startOf("week"),
+ dayjs().subtract(2, "week").endOf("week"),
bodyshop
) +
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyPaintTarget,
- moment().subtract(2, "week").startOf("week"),
- moment().subtract(2, "week").endOf("week"),
+ dayjs().subtract(2, "week").startOf("week"),
+ dayjs().subtract(2, "week").endOf("week"),
bodyshop
)
? "green"
@@ -366,8 +366,8 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
parseFloat(data.totalPriorWeekLAB) >=
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().subtract(2, "week").startOf("week"),
- moment().subtract(2, "week").endOf("week"),
+ dayjs().subtract(2, "week").startOf("week"),
+ dayjs().subtract(2, "week").endOf("week"),
bodyshop
)
? "green"
@@ -390,8 +390,8 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
parseFloat(data.totalPriorWeekLAR) >=
Util.WeeklyTargetHrsInPeriod(
bodyshop.scoreboard_target.dailyPaintTarget,
- moment().subtract(2, "week").startOf("week"),
- moment().subtract(2, "week").endOf("week"),
+ dayjs().subtract(2, "week").startOf("week"),
+ dayjs().subtract(2, "week").endOf("week"),
bodyshop
)
? "green"
diff --git a/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.targets-table.component.jsx b/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.targets-table.component.jsx
index d7bab48ad..e9dc3b991 100644
--- a/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.targets-table.component.jsx
+++ b/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.targets-table.component.jsx
@@ -1,6 +1,6 @@
import { CalendarOutlined } from "@ant-design/icons";
import { Card, Col, Divider, Row, Statistic } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -46,8 +46,8 @@ export function ScoreboardTimeticketsTargetsTable({ bodyshop }) {
title={t("scoreboard.labels.thisweek")}
value={Util.WeeklyTargetHrs(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().startOf("week"),
- moment().endOf("week"),
+ dayjs().startOf("week"),
+ dayjs().endOf("week"),
bodyshop
)}
/>
@@ -57,8 +57,8 @@ export function ScoreboardTimeticketsTargetsTable({ bodyshop }) {
title={t("scoreboard.labels.lastweek")}
value={Util.WeeklyTargetHrs(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().subtract(1, "week").startOf("week"),
- moment().subtract(1, "week").endOf("week"),
+ dayjs().subtract(1, "week").startOf("week"),
+ dayjs().subtract(1, "week").endOf("week"),
bodyshop
)}
/>
@@ -68,8 +68,8 @@ export function ScoreboardTimeticketsTargetsTable({ bodyshop }) {
title={t("scoreboard.labels.priorweek")}
value={Util.WeeklyTargetHrs(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().subtract(2, "week").startOf("week"),
- moment().subtract(2, "week").endOf("week"),
+ dayjs().subtract(2, "week").startOf("week"),
+ dayjs().subtract(2, "week").endOf("week"),
bodyshop
)}
/>
@@ -113,8 +113,8 @@ export function ScoreboardTimeticketsTargetsTable({ bodyshop }) {
@@ -123,8 +123,8 @@ export function ScoreboardTimeticketsTargetsTable({ bodyshop }) {
@@ -133,8 +133,8 @@ export function ScoreboardTimeticketsTargetsTable({ bodyshop }) {
@@ -182,14 +182,14 @@ export function ScoreboardTimeticketsTargetsTable({ bodyshop }) {
value={(
Util.WeeklyTargetHrs(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().startOf("week"),
- moment().endOf("week"),
+ dayjs().startOf("week"),
+ dayjs().endOf("week"),
bodyshop
) +
Util.WeeklyTargetHrs(
bodyshop.scoreboard_target.dailyPaintTarget,
- moment().startOf("week"),
- moment().endOf("week"),
+ dayjs().startOf("week"),
+ dayjs().endOf("week"),
bodyshop
)
).toFixed(1)}
@@ -200,14 +200,14 @@ export function ScoreboardTimeticketsTargetsTable({ bodyshop }) {
value={(
Util.WeeklyTargetHrs(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().subtract(1, "week").startOf("week"),
- moment().subtract(1, "week").endOf("week"),
+ dayjs().subtract(1, "week").startOf("week"),
+ dayjs().subtract(1, "week").endOf("week"),
bodyshop
) +
Util.WeeklyTargetHrs(
bodyshop.scoreboard_target.dailyPaintTarget,
- moment().subtract(1, "week").startOf("week"),
- moment().subtract(1, "week").endOf("week"),
+ dayjs().subtract(1, "week").startOf("week"),
+ dayjs().subtract(1, "week").endOf("week"),
bodyshop
)
).toFixed(1)}
@@ -218,14 +218,14 @@ export function ScoreboardTimeticketsTargetsTable({ bodyshop }) {
value={(
Util.WeeklyTargetHrs(
bodyshop.scoreboard_target.dailyBodyTarget,
- moment().subtract(2, "week").startOf("week"),
- moment().subtract(2, "week").endOf("week"),
+ dayjs().subtract(2, "week").startOf("week"),
+ dayjs().subtract(2, "week").endOf("week"),
bodyshop
) +
Util.WeeklyTargetHrs(
bodyshop.scoreboard_target.dailyPaintTarget,
- moment().subtract(2, "week").startOf("week"),
- moment().subtract(2, "week").endOf("week"),
+ dayjs().subtract(2, "week").startOf("week"),
+ dayjs().subtract(2, "week").endOf("week"),
bodyshop
)
).toFixed(1)}
diff --git a/client/src/components/scoreboard-timetickets/scoreboard-timetickets.component.jsx b/client/src/components/scoreboard-timetickets/scoreboard-timetickets.component.jsx
index 0fc84af6d..b764e2bc7 100644
--- a/client/src/components/scoreboard-timetickets/scoreboard-timetickets.component.jsx
+++ b/client/src/components/scoreboard-timetickets/scoreboard-timetickets.component.jsx
@@ -1,7 +1,7 @@
import { useQuery } from "@apollo/client";
import { Col, Row } from "antd";
import _ from "lodash";
-import moment from "moment";
+import dayjs from "../../utils/day";
import queryString from "query-string";
import React, { useMemo } from "react";
import { useLocation } from "react-router-dom";
@@ -16,22 +16,22 @@ export default function ScoreboardTimeTickets() {
const searchParams = queryString.parse(useLocation().search);
const { start, end } = searchParams;
const startDate = start
- ? moment(start)
- : moment().startOf("week").subtract(7, "days");
- const endDate = end ? moment(end) : moment().endOf("week");
+ ? dayjs(start)
+ : dayjs().startOf("week").subtract(7, "days");
+ const endDate = end ? dayjs(end) : dayjs().endOf("week");
const fixedPeriods = useMemo(() => {
- const endOfThisMonth = moment().endOf("month");
- const startofthisMonth = moment().startOf("month");
+ const endOfThisMonth = dayjs().endOf("month");
+ const startofthisMonth = dayjs().startOf("month");
- const endOfLastmonth = moment().subtract(1, "month").endOf("month");
- const startOfLastmonth = moment().subtract(1, "month").startOf("month");
+ const endOfLastmonth = dayjs().subtract(1, "month").endOf("month");
+ const startOfLastmonth = dayjs().subtract(1, "month").startOf("month");
- const endOfThisWeek = moment().endOf("week");
- const startOfThisWeek = moment().startOf("week");
+ const endOfThisWeek = dayjs().endOf("week");
+ const startOfThisWeek = dayjs().startOf("week");
- const endOfLastWeek = moment().subtract(1, "week").endOf("week");
- const startOfLastWeek = moment().subtract(1, "week").startOf("week");
+ const endOfLastWeek = dayjs().subtract(1, "week").endOf("week");
+ const startOfLastWeek = dayjs().subtract(1, "week").startOf("week");
const allDates = [
endOfThisMonth,
@@ -43,8 +43,8 @@ export default function ScoreboardTimeTickets() {
endOfLastWeek,
startOfLastWeek,
];
- const start = moment.min(allDates);
- const end = moment.max(allDates);
+ const start = dayjs.min(allDates);
+ const end = dayjs.max(allDates);
return {
start,
end,
@@ -85,7 +85,7 @@ export default function ScoreboardTimeTickets() {
employees: {},
};
data.fixedperiod.forEach((ticket) => {
- const ticketDate = moment(ticket.date);
+ const ticketDate = dayjs(ticket.date);
if (!ret.employees[ticket.employee.employee_number]) {
ret.employees[ticket.employee.employee_number] = {
@@ -167,7 +167,7 @@ export default function ScoreboardTimeTickets() {
listOfDays.forEach((day) => {
const r = {
- date: moment(day).format("MM/DD"),
+ date: dayjs(day).format("MM/DD"),
actualtotal: 0,
productivetotal: 0,
employees: {},
diff --git a/client/src/components/shop-employees/shop-employees-add-vacation.component.jsx b/client/src/components/shop-employees/shop-employees-add-vacation.component.jsx
index 01d115f6a..3b293f8b2 100644
--- a/client/src/components/shop-employees/shop-employees-add-vacation.component.jsx
+++ b/client/src/components/shop-employees/shop-employees-add-vacation.component.jsx
@@ -1,6 +1,6 @@
import { useMutation } from "@apollo/client";
import { Button, Card, Form, notification, Popover, Space } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
@@ -78,7 +78,7 @@ export default function ShopEmployeeAddVacation({ employee }) {
async validator(rule, value) {
if (value) {
const { start } = form.getFieldsValue();
- if (moment(start).isAfter(moment(value))) {
+ if (dayjs(start).isAfter(dayjs(value))) {
return Promise.reject(
t("employees.labels.endmustbeafterstart")
);
diff --git a/client/src/components/shop-employees/shop-employees-form.component.jsx b/client/src/components/shop-employees/shop-employees-form.component.jsx
index ab855ee28..2778d00ba 100644
--- a/client/src/components/shop-employees/shop-employees-form.component.jsx
+++ b/client/src/components/shop-employees/shop-employees-form.component.jsx
@@ -12,7 +12,7 @@ import {
Table,
} from "antd";
import { useForm } from "antd/es/form/Form";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -132,7 +132,7 @@ export function ShopEmployeesFormComponent({ bodyshop }) {
dataIndex: "length",
key: "length",
render: (text, record) =>
- moment(record.end).diff(moment(record.start), "days", true).toFixed(1),
+ dayjs(record.end).diff(dayjs(record.start), "days", true).toFixed(1),
},
{
title: t("general.labels.actions"),
diff --git a/client/src/components/shop-info/shop-info.container.jsx b/client/src/components/shop-info/shop-info.container.jsx
index dd254a4cb..5708d72fd 100644
--- a/client/src/components/shop-info/shop-info.container.jsx
+++ b/client/src/components/shop-info/shop-info.container.jsx
@@ -1,6 +1,6 @@
import { useMutation, useQuery } from "@apollo/client";
import { Form, notification } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
@@ -58,21 +58,21 @@ export default function ShopInfoContainer() {
accountingconfig: {
...data.bodyshops[0].accountingconfig,
ClosingPeriod: [
- moment(data.bodyshops[0].accountingconfig.ClosingPeriod[0]),
- moment(data.bodyshops[0].accountingconfig.ClosingPeriod[1]),
+ dayjs(data.bodyshops[0].accountingconfig.ClosingPeriod[0]),
+ dayjs(data.bodyshops[0].accountingconfig.ClosingPeriod[1]),
],
},
- schedule_start_time: moment(
+ schedule_start_time: dayjs(
data.bodyshops[0].schedule_start_time
),
- schedule_end_time: moment(data.bodyshops[0].schedule_end_time),
+ schedule_end_time: dayjs(data.bodyshops[0].schedule_end_time),
}
: {
...data.bodyshops[0],
- schedule_start_time: moment(
+ schedule_start_time: dayjs(
data.bodyshops[0].schedule_start_time
),
- schedule_end_time: moment(data.bodyshops[0].schedule_end_time),
+ schedule_end_time: dayjs(data.bodyshops[0].schedule_end_time),
}
: null
}
diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx
index 5f7d31c03..546d21796 100644
--- a/client/src/components/shop-info/shop-info.general.component.jsx
+++ b/client/src/components/shop-info/shop-info.general.component.jsx
@@ -11,7 +11,6 @@ import {
Space,
Switch,
} from "antd";
-import momentTZ from "moment-timezone";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -25,7 +24,8 @@ import PhoneFormItem, {
} from "../form-items-formatted/phone-form-item.component";
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
-const timeZonesList = momentTZ.tz.names();
+// TODO: Client Update, this might break
+const timeZonesList = Intl.supportedValuesOf('timeZone');
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
diff --git a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx
index 3d7c88635..e500c1f8d 100644
--- a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx
+++ b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx
@@ -1,8 +1,7 @@
import { useMutation } from "@apollo/client";
import { Button, Card, Form, notification, Space } from "antd";
import axios from "axios";
-import moment from "moment";
-import momenttz from "moment-timezone";
+import dayjs from "../../utils/day";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -58,13 +57,14 @@ export function TechClockInContainer({
employeeid: technician.id,
date:
typeof bodyshop.timezone === "string"
- ? momenttz.tz(theTime, bodyshop.timezone).format("YYYY-MM-DD")
+ // TODO: Client Update - This may be broken
+ ? dayjs.tz(theTime, bodyshop.timezone).format("YYYY-MM-DD")
: typeof bodyshop.timezone === "number"
- ? moment(theTime)
+ ? dayjs(theTime)
.format("YYYY-MM-DD")
.utcOffset(bodyshop.timezone)
- : moment(theTime).format("YYYY-MM-DD"),
- clockon: moment(theTime),
+ : dayjs(theTime).format("YYYY-MM-DD"),
+ clockon: dayjs(theTime),
jobid: values.jobid,
cost_center: values.cost_center,
ciecacode:
diff --git a/client/src/components/tech-job-print-tickets/tech-job-print-tickets.component.jsx b/client/src/components/tech-job-print-tickets/tech-job-print-tickets.component.jsx
index 2378048e3..4cc1b9eed 100644
--- a/client/src/components/tech-job-print-tickets/tech-job-print-tickets.component.jsx
+++ b/client/src/components/tech-job-print-tickets/tech-job-print-tickets.component.jsx
@@ -1,5 +1,5 @@
import { Button, Card, DatePicker, Form, Popover, Radio, Space } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -51,13 +51,13 @@ export function TechJobPrintTickets({ technician, event, attendacePrint }) {
: Templates.timetickets_employee.key,
variables: {
...(start
- ? { start: moment(start).startOf("day").format("YYYY-MM-DD") }
+ ? { start: dayjs(start).startOf("day").format("YYYY-MM-DD") }
: {}),
...(end
- ? { end: moment(end).endOf("day").format("YYYY-MM-DD") }
+ ? { end: dayjs(end).endOf("day").format("YYYY-MM-DD") }
: {}),
- ...(start ? { starttz: moment(start).startOf("day") } : {}),
- ...(end ? { endtz: moment(end).endOf("day") } : {}),
+ ...(start ? { starttz: dayjs(start).startOf("day") } : {}),
+ ...(end ? { endtz: dayjs(end).endOf("day") } : {}),
id: technician.id,
},
diff --git a/client/src/components/tech-job-statistics/tech-job-statistics.component.jsx b/client/src/components/tech-job-statistics/tech-job-statistics.component.jsx
index df7f2af75..479aacb33 100644
--- a/client/src/components/tech-job-statistics/tech-job-statistics.component.jsx
+++ b/client/src/components/tech-job-statistics/tech-job-statistics.component.jsx
@@ -1,6 +1,6 @@
import { useQuery } from "@apollo/client";
import { Card, Col, Space, Statistic, Typography } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -19,8 +19,8 @@ const mapDispatchToProps = (dispatch) => ({});
const TechJobStatistics = ({ technician }) => {
const { t } = useTranslation();
- const startDate = moment().startOf("week");
- const endDate = moment().endOf("week");
+ const startDate = dayjs().startOf("week");
+ const endDate = dayjs().endOf("week");
const { loading, error, data } = useQuery(
QUERY_TIME_TICKETS_TECHNICIAN_IN_RANGE,
@@ -28,8 +28,8 @@ const TechJobStatistics = ({ technician }) => {
variables: {
start: startDate.format("YYYY-MM-DD"),
end: endDate.format("YYYY-MM-DD"),
- fixedStart: moment().startOf("month").format("YYYY-MM-DD"),
- fixedEnd: moment().endOf("month").format("YYYY-MM-DD"),
+ fixedStart: dayjs().startOf("month").format("YYYY-MM-DD"),
+ fixedEnd: dayjs().endOf("month").format("YYYY-MM-DD"),
employeeid: technician.id,
},
fetchPolicy: "network-only",
diff --git a/client/src/components/ticket-tickets-dates-selector/time-tickets-dates-selector.component.jsx b/client/src/components/ticket-tickets-dates-selector/time-tickets-dates-selector.component.jsx
index d1066daf7..3b5932fba 100644
--- a/client/src/components/ticket-tickets-dates-selector/time-tickets-dates-selector.component.jsx
+++ b/client/src/components/ticket-tickets-dates-selector/time-tickets-dates-selector.component.jsx
@@ -1,6 +1,6 @@
import DatePickerRanges from "../../utils/DatePickerRanges";
import { DatePicker } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import queryString from "query-string";
import React from "react";
import { useNavigate, useLocation } from "react-router-dom";
@@ -37,8 +37,8 @@ export default function TimeTicketsDatesSelector() {
return (
- {moment(record.clockoff)
- .diff(moment(record.clockon), "hours", true)
+ {dayjs(record.clockoff)
+ .diff(dayjs(record.clockon), "hours", true)
.toFixed(2)}
);
diff --git a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx
index 6df9f2b9f..01c273486 100644
--- a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx
+++ b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx
@@ -291,6 +291,7 @@ export function TimeTicketModalComponent({
return Promise.reject(
t("timetickets.validation.clockoffwithoutclockon")
);
+ // TODO - Verify this exists
if (
value &&
value.isSameOrAfter &&
diff --git a/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx b/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx
index de2abff5e..c365ff5ca 100644
--- a/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx
+++ b/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx
@@ -1,7 +1,7 @@
import { useMutation, useQuery } from "@apollo/client";
import { Button, Form, Modal, Space, notification } from "antd";
import {PageHeader} from "@ant-design/pro-layout";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -210,7 +210,7 @@ export function TimeTicketModalContainer({
timeTicketModal.context.timeticket.jobid ||
null,
date: timeTicketModal.context.timeticket.date
- ? moment(timeTicketModal.context.timeticket.date)
+ ? dayjs(timeTicketModal.context.timeticket.date)
: null,
}
: { jobid: timeTicketModal.context.jobId || null }
diff --git a/client/src/components/time-ticket-shift-form/time-ticket-shift-form.container.jsx b/client/src/components/time-ticket-shift-form/time-ticket-shift-form.container.jsx
index 8c3c3cd0d..759840780 100644
--- a/client/src/components/time-ticket-shift-form/time-ticket-shift-form.container.jsx
+++ b/client/src/components/time-ticket-shift-form/time-ticket-shift-form.container.jsx
@@ -1,8 +1,7 @@
import { useMutation } from "@apollo/client";
import { Button, Form, Space, notification } from "antd";
import axios from "axios";
-import moment from "moment";
-import momenttz from "moment-timezone";
+import dayjs from "../../utils/day";
import React, { useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -59,7 +58,7 @@ export function TimeTicektShiftContainer({
message: t("timetickets.errors.shiftalreadyclockedon"),
});
} else {
- const theTime = moment((await axios.post("/utils/time")).data);
+ const theTime = dayjs((await axios.post("/utils/time")).data);
const result = await insertTimeTicket({
variables: {
@@ -71,12 +70,13 @@ export function TimeTicektShiftContainer({
clockon: theTime,
date:
typeof bodyshop.timezone === "string"
- ? momenttz.tz(theTime, bodyshop.timezone).format("YYYY-MM-DD")
+ // TODO: Client Update - This may be broken
+ ? dayjs.tz(theTime, bodyshop.timezone).format("YYYY-MM-DD")
: typeof bodyshop.timezone === "number"
- ? moment(theTime)
+ ? dayjs(theTime)
.utcOffset(bodyshop.timezone)
.format("YYYY-MM-DD")
- : moment(theTime).format("YYYY-MM-DD"),
+ : dayjs(theTime).format("YYYY-MM-DD"),
memo: values.memo,
created_by: isTechConsole
? currentUser.email.concat(
diff --git a/client/src/components/time-tickets-attendance-table/time-tickets-attendance-table.component.jsx b/client/src/components/time-tickets-attendance-table/time-tickets-attendance-table.component.jsx
index ce7c4b34f..b30f62b7d 100644
--- a/client/src/components/time-tickets-attendance-table/time-tickets-attendance-table.component.jsx
+++ b/client/src/components/time-tickets-attendance-table/time-tickets-attendance-table.component.jsx
@@ -5,7 +5,7 @@ import { useLocation } from "react-router-dom";
import { GenerateDocument } from "../../utils/RenderTemplate";
import { TemplateList } from "../../utils/TemplateConstants";
import { useTranslation } from "react-i18next";
-import moment from "moment";
+import dayjs from "../../utils/day";
const AttendanceCsv = TemplateList("special").attendance_detail_csv;
export default function TimeTicketsAttendanceTable() {
@@ -23,8 +23,8 @@ export default function TimeTicketsAttendanceTable() {
variables: {
start: start
? start
- : moment().startOf("week").subtract(7, "days").format("YYYY-MM-DD"),
- end: end ? end : moment().endOf("week").format("YYYY-MM-DD"),
+ : dayjs().startOf("week").subtract(7, "days").format("YYYY-MM-DD"),
+ end: end ? end : dayjs().endOf("week").format("YYYY-MM-DD"),
},
},
{},
diff --git a/client/src/components/time-tickets-payroll-table/time-tickets-payroll-table.component.jsx b/client/src/components/time-tickets-payroll-table/time-tickets-payroll-table.component.jsx
index 731d94273..2083b15dc 100644
--- a/client/src/components/time-tickets-payroll-table/time-tickets-payroll-table.component.jsx
+++ b/client/src/components/time-tickets-payroll-table/time-tickets-payroll-table.component.jsx
@@ -5,7 +5,7 @@ import { useLocation } from "react-router-dom";
import { GenerateDocument } from "../../utils/RenderTemplate";
import { TemplateList } from "../../utils/TemplateConstants";
import { useTranslation } from "react-i18next";
-import moment from "moment";
+import dayjs from "../../utils/day";
const PayrollTemplate = TemplateList("special").exported_payroll;
export default function TimeTicketsPayrollTable() {
const searchParams = queryString.parse(useLocation().search);
@@ -22,8 +22,8 @@ export default function TimeTicketsPayrollTable() {
variables: {
start: start
? start
- : moment().startOf("week").subtract(7, "days").format("YYYY-MM-DD"),
- end: end ? end : moment().endOf("week").format("YYYY-MM-DD"),
+ : dayjs().startOf("week").subtract(7, "days").format("YYYY-MM-DD"),
+ end: end ? end : dayjs().endOf("week").format("YYYY-MM-DD"),
},
},
{},
diff --git a/client/src/components/time-tickets-summary-employees/time-tickets-summary-employees.component.jsx b/client/src/components/time-tickets-summary-employees/time-tickets-summary-employees.component.jsx
index b51d45680..a6745aee7 100644
--- a/client/src/components/time-tickets-summary-employees/time-tickets-summary-employees.component.jsx
+++ b/client/src/components/time-tickets-summary-employees/time-tickets-summary-employees.component.jsx
@@ -1,6 +1,6 @@
import { Card, Col, Row, Table } from "antd";
import _ from "lodash";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -124,7 +124,7 @@ const JobRelatedTicketsTable = ({
if (!!val.clockoff && !!val.clockon)
return (
acc +
- moment(val.clockoff).diff(moment(val.clockon), "hours", true)
+ dayjs(val.clockoff).diff(dayjs(val.clockon), "hours", true)
);
return acc;
}, 0);
@@ -251,7 +251,7 @@ const ShiftRelatedTicketsTable = ({
const clockHrs = item.tickets.reduce((acc, val) => {
if (!!val.clockoff && !!val.clockon)
return (
- acc + moment(val.clockoff).diff(moment(val.clockon), "hours", true)
+ acc + dayjs(val.clockoff).diff(dayjs(val.clockon), "hours", true)
);
return acc;
}, 0);
diff --git a/client/src/components/vehicle-detail-form/vehicle-detail-form.container.jsx b/client/src/components/vehicle-detail-form/vehicle-detail-form.container.jsx
index 22e72c673..0fc7f9cd1 100644
--- a/client/src/components/vehicle-detail-form/vehicle-detail-form.container.jsx
+++ b/client/src/components/vehicle-detail-form/vehicle-detail-form.container.jsx
@@ -4,7 +4,7 @@ import {PageHeader} from "@ant-design/pro-layout";
import { useMutation } from "@apollo/client";
import VehicleDetailFormComponent from "./vehicle-detail-form.component";
import { useTranslation } from "react-i18next";
-import moment from "moment";
+import dayjs from "../../utils/day";
import { DELETE_VEHICLE, UPDATE_VEHICLE } from "../../graphql/vehicles.queries";
import { useNavigate } from "react-router-dom";
@@ -97,7 +97,7 @@ function VehicleDetailFormContainer({ vehicle, refetch }) {
layout="vertical"
initialValues={{
...vehicle,
- v_prod_dt: vehicle.v_prod_dt ? moment(vehicle.v_prod_dt) : null,
+ v_prod_dt: vehicle.v_prod_dt ? dayjs(vehicle.v_prod_dt) : null,
}}
>
diff --git a/client/src/pages/contract-detail/contract-detail.page.container.jsx b/client/src/pages/contract-detail/contract-detail.page.container.jsx
index 86d5148b1..84058f39d 100644
--- a/client/src/pages/contract-detail/contract-detail.page.container.jsx
+++ b/client/src/pages/contract-detail/contract-detail.page.container.jsx
@@ -1,6 +1,6 @@
import { useMutation, useQuery } from "@apollo/client";
import { Form, notification } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -139,19 +139,19 @@ export function ContractDetailPageContainer({
initialValues={{
...data.cccontracts_by_pk,
start: data.cccontracts_by_pk.start
- ? moment(data.cccontracts_by_pk.start)
+ ? dayjs(data.cccontracts_by_pk.start)
: null,
scheduledreturn: data.cccontracts_by_pk.scheduledreturn
- ? moment(data.cccontracts_by_pk.scheduledreturn)
+ ? dayjs(data.cccontracts_by_pk.scheduledreturn)
: null,
actualreturn: data.cccontracts_by_pk.actualreturn
- ? moment(data.cccontracts_by_pk.actualreturn)
+ ? dayjs(data.cccontracts_by_pk.actualreturn)
: null,
driver_dlexpiry: data.cccontracts_by_pk.driver_dlexpiry
- ? moment(data.cccontracts_by_pk.driver_dlexpiry)
+ ? dayjs(data.cccontracts_by_pk.driver_dlexpiry)
: null,
driver_dob: data.cccontracts_by_pk.driver_dob
- ? moment(data.cccontracts_by_pk.driver_dob)
+ ? dayjs(data.cccontracts_by_pk.driver_dob)
: null,
}}
>
diff --git a/client/src/pages/courtesy-car-detail/courtesy-car-detail.page.container.jsx b/client/src/pages/courtesy-car-detail/courtesy-car-detail.page.container.jsx
index 92e176960..ba2bb5501 100644
--- a/client/src/pages/courtesy-car-detail/courtesy-car-detail.page.container.jsx
+++ b/client/src/pages/courtesy-car-detail/courtesy-car-detail.page.container.jsx
@@ -1,6 +1,6 @@
import { useMutation, useQuery } from "@apollo/client";
import { Form, notification } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -154,25 +154,25 @@ export function CourtesyCarDetailPageContainer({
? {
...data.courtesycars_by_pk,
purchasedate: data.courtesycars_by_pk.purchasedate
- ? moment(data.courtesycars_by_pk.purchasedate)
+ ? dayjs(data.courtesycars_by_pk.purchasedate)
: null,
servicestartdate: data.courtesycars_by_pk.servicestartdate
- ? moment(data.courtesycars_by_pk.servicestartdate)
+ ? dayjs(data.courtesycars_by_pk.servicestartdate)
: null,
serviceenddate: data.courtesycars_by_pk.serviceenddate
- ? moment(data.courtesycars_by_pk.serviceenddate)
+ ? dayjs(data.courtesycars_by_pk.serviceenddate)
: null,
leaseenddate: data.courtesycars_by_pk.leaseenddate
- ? moment(data.courtesycars_by_pk.leaseenddate)
+ ? dayjs(data.courtesycars_by_pk.leaseenddate)
: null,
nextservicedate: data.courtesycars_by_pk.nextservicedate
- ? moment(data.courtesycars_by_pk.nextservicedate)
+ ? dayjs(data.courtesycars_by_pk.nextservicedate)
: null,
registrationexpires: data.courtesycars_by_pk.registrationexpires
- ? moment(data.courtesycars_by_pk.registrationexpires)
+ ? dayjs(data.courtesycars_by_pk.registrationexpires)
: null,
insuranceexpires: data.courtesycars_by_pk.insuranceexpires
- ? moment(data.courtesycars_by_pk.insuranceexpires)
+ ? dayjs(data.courtesycars_by_pk.insuranceexpires)
: null,
}
: {}
diff --git a/client/src/pages/jobs-checklist-view/jobs-checklist-view.page.jsx b/client/src/pages/jobs-checklist-view/jobs-checklist-view.page.jsx
index d53a83a90..d0999dd72 100644
--- a/client/src/pages/jobs-checklist-view/jobs-checklist-view.page.jsx
+++ b/client/src/pages/jobs-checklist-view/jobs-checklist-view.page.jsx
@@ -1,6 +1,6 @@
import { useQuery } from "@apollo/client";
import { Col, Row, Typography } from "antd";
-import moment from "moment";
+import dayjs from "../../utils/day";
import React, { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -66,7 +66,7 @@ export function JobsChecklistViewContainer({
{t("jobs.labels.checklistcompletedby", {
by: checklist.completed_by,
- at: moment(checklist.completed_at).format("MM/DD/YYYY @ h:mm a"),
+ at: dayjs(checklist.completed_at).format("MM/DD/YYYY @ h:mm a"),
})}