Skip to content

Commit 7b42471

Browse files
authored
Merge pull request #7134 from topcoder-platform/develop
Clean up logs / PM-2525
2 parents 263835b + 7afc90e commit 7b42471

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/shared/containers/tc-communities/Loader.jsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ class Loader extends React.Component {
103103
// to see the "Public Site" on Zurich
104104
if (communityId === 'zurich') return Community({ member, meta });
105105
// All other get the not authorized page
106-
107-
console.log('Rendering Access Denied - Not Authenticated for !visitorGroups');
108-
console.log(visitorGroups, meta, communityId, member);
109-
110106
return (
111107
<AccessDenied
112108
cause={ACCESS_DENIED_REASON.NOT_AUTHENTICATED}
@@ -129,10 +125,6 @@ class Loader extends React.Component {
129125
// to any groups authorized to access this community
130126
return Community({ member, meta });
131127
}
132-
133-
console.log('Rendering Access Denied - Not Authenticated');
134-
console.log(visitorGroups, meta, communityId, member);
135-
136128
/* Visitor is not authorized to access this community. */
137129
return (
138130
<AccessDenied

src/shared/utils/challenge-listing/helper.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import moment from 'moment';
66
* @return {Date}
77
*/
88
export function phaseEndDate(phase) {
9+
if (phase.actualEndDate) {
10+
return new Date(phase.actualEndDate);
11+
}
912
// Case 1: phase is still open. take the `scheduledEndDate`
1013
// Case 2: phase is not open but `scheduledStartDate` is a future date.
1114
// This means phase is not yet started. So take the `scheduledEndDate`
@@ -17,7 +20,7 @@ export function phaseEndDate(phase) {
1720
return new Date(phase.scheduledEndDate);
1821
}
1922
// for other cases, take the `actualEndDate` as phase is already closed
20-
return new Date(phase.scheduledEndDate || phase.actualEndDate);
23+
return new Date(phase.actualEndDate || phase.scheduledEndDate);
2124
}
2225

2326
/**
@@ -26,12 +29,15 @@ export function phaseEndDate(phase) {
2629
* @return {Date}
2730
*/
2831
export function phaseStartDate(phase) {
32+
if (phase.actualStartDate) {
33+
return new Date(phase.actualStartDate);
34+
}
2935
// Case 1: Phase is not yet started. take the `scheduledStartDate`
3036
if (phase.isOpen !== true && moment(phase.scheduledStartDate).isAfter()) {
3137
return new Date(phase.scheduledStartDate);
3238
}
3339
// For all other cases, take the `actualStartDate` as phase is already started
34-
return new Date(phase.scheduledStartDate || phase.actualStartDate);
40+
return new Date(phase.actualStartDate || phase.scheduledStartDate);
3541
}
3642

3743
/**

0 commit comments

Comments
 (0)