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,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(
|
||||
|
||||
Reference in New Issue
Block a user