This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 2 files changed +22
-2
lines changed
routes/MyTeamsDetails/components/TeamPositions
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import SkillsList, { skillShape } from "components/SkillsList";
10
10
import Button from "components/Button" ;
11
11
import { POSITION_STATUS , POSITION_STATUS_TO_TEXT , RATE_TYPE } from "constants" ;
12
12
import "./styles.module.scss" ;
13
- import { formatDateRange } from "utils/format" ;
13
+ import { formatJobDate } from "utils/format" ;
14
14
import { Link } from "@reach/router" ;
15
15
16
16
const TeamPositions = ( { teamId, positions } ) => {
@@ -44,7 +44,7 @@ const TeamPositions = ({ teamId, positions }) => {
44
44
</ div >
45
45
< div styleName = "table-group-first-inner" >
46
46
< div styleName = "table-cell cell-date" >
47
- { formatDateRange ( position . startDate , position . endDate ) }
47
+ { formatJobDate ( position . startDate , position . duration ) }
48
48
</ div >
49
49
< div styleName = "table-cell cell-money" >
50
50
{ /* Hide rate as we don't have data for it */ }
Original file line number Diff line number Diff line change @@ -200,3 +200,23 @@ export const formatPageTitle = (pageTitle) => {
200
200
201
201
return formattedPageTitle ;
202
202
} ;
203
+
204
+ /**
205
+ * Format job date
206
+ *
207
+ * @param {string } startDate job startDate
208
+ * @param {number } duration job duration
209
+ *
210
+ * @returns {string } formatted string
211
+ */
212
+ export const formatJobDate = ( startDate , duration ) => {
213
+ const dateStr = startDate ? moment ( startDate ) . format ( DAY_FORMAT ) : "" ;
214
+ if ( startDate && duration ) {
215
+ return `Requested starting ${ dateStr } for ${ duration } weeks` ;
216
+ } else if ( startDate ) {
217
+ return `Requested starting ${ dateStr } ` ;
218
+ } else if ( duration ) {
219
+ return `${ duration } weeks` ;
220
+ }
221
+ return "" ;
222
+ } ;
You can’t perform that action at this time.
0 commit comments