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:
@@ -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")
|
||||
);
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user