Skip to content

Commit dce2f45

Browse files
author
vikasrohit
committed
Merge branch 'hotfix/srm-tile-wrong-end-date'
2 parents 034b5ac + c422951 commit dce2f45

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

app/directives/srm-tile/srm-tile.directive.jade

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
77

88
.srm-details
9-
p.starts-in Starts in #[span {{srm.startDate | timeDiff:"quantity"}} {{srm.startDate | timeDiff:'unit'}}]
9+
p.starts-in Starts in #[span {{srm.codingStartAt | timeDiff:"quantity"}} {{srm.codingStartAt | timeDiff:'unit'}}]
1010

1111
.srm-calendar
12-
span.day {{srm.startDate | localTime:"DD" }}
13-
span.month {{srm.startDate | localTime:"MMM" }}
14-
span.hour {{srm.startDate | localTime:"hh:mm a" }}
15-
span.time-zone {{srm.startDate | localTime:"z" }}
12+
span.day {{srm.codingStartAt | localTime:"DD" }}
13+
span.month {{srm.codingStartAt | localTime:"MMM" }}
14+
span.hour {{srm.codingStartAt | localTime:"hh:mm a" }}
15+
span.time-zone {{srm.codingStartAt | localTime:"z" }}
1616

1717
.phase-status
1818
.registered(ng-show="vm.registered")
@@ -26,7 +26,7 @@
2626

2727
header
2828
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
29-
.ended-on #[span {{srm.startDate | localTime:"MMM DD, YYYY" }}]
29+
.ended-on #[span {{srm.codingEndAt | localTime:"MMM DD, YYYY" }}]
3030

3131
.member-stats
3232
p.points #[span {{srm.result.finalPoints }}] #[span Points]
@@ -47,7 +47,7 @@
4747
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
4848

4949
.srm-details
50-
p.starts-in Starts in #[span {{srm.startDate | timeDiff:"quantity"}} {{srm.startDate | timeDiff:'unit'}}]
50+
p.starts-in Starts in #[span {{srm.codingStartAt | timeDiff:"quantity"}} {{srm.codingStartAt | timeDiff:'unit'}}]
5151

5252
.phase-status
5353
.registered(ng-show="vm.registered")
@@ -63,7 +63,7 @@
6363
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
6464

6565
.srm-details
66-
p.ended-on Ended {{srm.endDate | timeDiff:"quantity"}} {{srm.endDate | timeDiff:'unit'}} ago
66+
p.ended-on Ended {{srm.codingEndAt | timeDiff:"quantity"}} {{srm.codingEndAt | timeDiff:'unit'}} ago
6767

6868
.member-stats
6969
p.points #[span {{srm.result.finalPoints }}] Points

app/directives/srm-tile/srm-tile.directive.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@
1414
$scope.DOMAIN = CONSTANTS.domain;
1515
// TODO removed hard coded value
1616
$scope.registered = false;
17-
if (Array.isArray($scope.srm.rounds) && $scope.srm.rounds.length &&
18-
$scope.srm.rounds[0].userSRMDetails && $scope.srm.rounds[0].userSRMDetails.rated) {
19-
$scope.srm.result = $scope.srm.rounds[0].userSRMDetails;
17+
if (Array.isArray($scope.srm.rounds) && $scope.srm.rounds.length) {
18+
if ($scope.srm.rounds[0].userSRMDetails && $scope.srm.rounds[0].userSRMDetails.rated) {
19+
$scope.srm.result = $scope.srm.rounds[0].userSRMDetails;
20+
}
21+
if ($scope.srm.rounds[0].codingStartAt) {
22+
$scope.srm.codingStartAt = $scope.srm.rounds[0].codingStartAt;
23+
}
24+
if ($scope.srm.rounds[0].codingEndAt) {
25+
$scope.srm.codingEndAt = $scope.srm.rounds[0].codingEndAt;
26+
}
2027
}
2128
}]
2229
};

0 commit comments

Comments
 (0)