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

Commit 7c097b8

Browse files
Merge pull request #511 from yoution/issue-507
[PROD] Release: Job Start Date
2 parents b586ff3 + a1b485e commit 7c097b8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
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
};

0 commit comments

Comments
 (0)