IO-1912 Resolve date for tech clock in.

This commit is contained in:
Patrick Fic
2022-05-27 14:34:02 -07:00
parent 885a861f1e
commit 595ec72edd
3 changed files with 11 additions and 10 deletions

View File

@@ -10,6 +10,7 @@ import { selectTechnician } from "../../redux/tech/tech.selectors";
import { selectBodyshop } from "../../redux/user/user.selectors";
import TechClockInComponent from "./tech-job-clock-in-form.component";
import TechJobPrintTickets from "../tech-job-print-tickets/tech-job-print-tickets.component";
import moment from "moment";
const mapStateToProps = createStructuredSelector({
technician: selectTechnician,
@@ -23,18 +24,19 @@ export function TechClockInContainer({ technician, bodyshop }) {
refetchQueries: ["QUERY_ACTIVE_TIME_TICKETS"],
});
const { t } = useTranslation();
console.log(moment("2022-05-28T01:43:52.508Z").format("YYYY-MM-DD"));
const handleFinish = async (values) => {
setLoading(true);
const theTime = (await axios.post("/utils/time")).data;
const result = await insertTimeTicket({
variables: {
timeTicketInput: [
{
bodyshopid: bodyshop.id,
employeeid: technician.id,
date: theTime,
clockon: theTime,
date: moment(theTime).format("YYYY-MM-DD"),
clockon: moment(theTime),
jobid: values.jobid,
cost_center: values.cost_center,
ciecacode: