Skip to content

Commit 4842ea1

Browse files
committed
fix: avoid setting todays dates for phase
1 parent b6e8c9d commit 4842ea1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/projects/actions/project.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,12 @@ export function updatePhase(projectId, phaseId, updatedProps, phaseIndex) {
467467
const startDateChanged = updatedProps.startDate ? updatedProps.startDate.diff(phaseStartDate) : null
468468
const phaseActivated = phaseStatusChanged && updatedProps.status === PHASE_STATUS_ACTIVE
469469

470-
updatedProps.startDate = moment(updatedProps.startDate).format('YYYY-MM-DD')
471-
updatedProps.endDate = moment(updatedProps.endDate).format('YYYY-MM-DD')
470+
if (updatedProps.startDate) {
471+
updatedProps.startDate = moment(updatedProps.startDate).format('YYYY-MM-DD')
472+
}
473+
if (updatedProps.endDate) {
474+
updatedProps.endDate = moment(updatedProps.endDate).format('YYYY-MM-DD')
475+
}
472476

473477
return dispatch({
474478
type: UPDATE_PHASE,

0 commit comments

Comments
 (0)