Skip to content

Commit 4f5c91d

Browse files
author
Vikas Agarwal
committed
allowing startDate === endDate
1 parent 132772c commit 4f5c91d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/routes/phases/update.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ module.exports = [
7373
endDate = existing.endDate !== null ? new Date(existing.endDate) : null;
7474
}
7575

76-
if (startDate !== null && endDate !== null && startDate >= endDate) {
77-
const err = new Error('startDate must be before endDate.');
76+
if (startDate !== null && endDate !== null && startDate > endDate) {
77+
const err = new Error('startDate must not be after endDate.');
7878
err.status = 400;
7979
reject(err);
8080
} else {

src/routes/phases/update.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ describe('Project Phases', () => {
167167
.expect(422, done);
168168
});
169169

170-
it('should return 400 when startDate >= endDate', (done) => {
170+
it('should return 400 when startDate > endDate', (done) => {
171171
request(server)
172172
.patch(`/v4/projects/${projectId}/phases/${phaseId}`)
173173
.set({

0 commit comments

Comments
 (0)