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

@@ -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 (
<div className="schedule-job-modal">