Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit e7e7eb0

Browse files
committed
1 parent 62902e4 commit e7e7eb0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/routes/JobForm/index.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import React, { useState, useEffect } from "react";
99
import PT from "prop-types";
1010
import { toastr } from "react-redux-toastr";
11+
import moment from 'moment';
1112
import _ from "lodash";
1213
import store from "../../store";
1314
import Page from "components/Page";
@@ -33,6 +34,9 @@ const JobForm = ({ teamId, jobId }) => {
3334
const title = isEdit ? "Edit Job Details" : "Create Job";
3435

3536
const onSubmit = async (values) => {
37+
if (values.startDate) {
38+
values.startDate = moment(values.startDate).format('YYYY-MM-DD')
39+
}
3640
if (isEdit) {
3741
await updateJob(values, jobId).then(
3842
() => {

src/services/teams.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
axiosInstance as axios,
66
fetchCustom as fetch,
77
} from "./requestInterceptor";
8-
8+
import _ from "lodash";
9+
import moment from "moment";
910
import config from "../../config";
1011

1112
/**
@@ -257,6 +258,11 @@ export const searchRoles = (searchObject) => {
257258
* @returns {Promise<object>} object containing new projectId
258259
*/
259260
export const postTeamRequest = (teamObject) => {
261+
_.forEach(teamObject.positions, (p) => {
262+
if (p.startMonth) {
263+
p.startMonth = moment(p.startMonth).format("YYYY-MM-DD");
264+
}
265+
});
260266
const url = `${config.API.V5}/taas-teams/submitTeamRequest`;
261267
return axios.post(url, teamObject);
262268
};

src/utils/format.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ export const formatOpenPositions = (job, resources) => {
299299
* @returns {string} formatted string
300300
*/
301301
export const formatJobDate = (startDate, duration) => {
302-
const dateStr = startDate ? moment(startDate).format(DAY_FORMAT) : "";
302+
const dateStr = startDate ? startDate : "";
303303

304304
if (startDate && duration) {
305305
return `Requested starting ${dateStr} for ${formatPlural(

0 commit comments

Comments
 (0)