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:
@@ -2,7 +2,7 @@ import { WarningFilled } from "@ant-design/icons";
|
||||
import { useApolloClient } from "@apollo/client";
|
||||
import { Button, Form, Input, InputNumber, Space } from "antd";
|
||||
import {PageHeader} from "@ant-design/pro-layout";
|
||||
import moment from "moment";
|
||||
import dayjs from "../../utils/day";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { CHECK_CC_FLEET_NUMBER } from "../../graphql/courtesy-car.queries";
|
||||
@@ -259,7 +259,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
||||
const nextservicedate = form.getFieldValue("nextservicedate");
|
||||
const dueForService =
|
||||
nextservicedate &&
|
||||
moment(nextservicedate).endOf("day").isSameOrBefore(moment());
|
||||
dayjs(nextservicedate).endOf("day").isSameOrBefore(dayjs());
|
||||
|
||||
if (dueForService)
|
||||
return (
|
||||
@@ -300,7 +300,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
||||
const expires = form.getFieldValue("registrationexpires");
|
||||
|
||||
const dateover =
|
||||
expires && moment(expires).endOf("day").isBefore(moment());
|
||||
expires && dayjs(expires).endOf("day").isBefore(dayjs());
|
||||
|
||||
if (dateover)
|
||||
return (
|
||||
@@ -336,7 +336,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
||||
const expires = form.getFieldValue("insuranceexpires");
|
||||
|
||||
const dateover =
|
||||
expires && moment(expires).endOf("day").isBefore(moment());
|
||||
expires && dayjs(expires).endOf("day").isBefore(dayjs());
|
||||
|
||||
if (dateover)
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user