File tree 1 file changed +5
-6
lines changed
src/components/ChallengeEditor/ChallengeSchedule-Field
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ class ChallengeScheduleField extends Component {
99
99
]
100
100
)
101
101
102
- var secondToMilisecond = 1000 // = 1 second
102
+ var hourToMilisecond = 60 * 60 * 1000 // = 1 hour
103
103
_ . map ( allPhases , ( p , index ) => {
104
104
const phase = this . getChallengePhase ( p )
105
105
if ( phase && timelines ) {
@@ -117,15 +117,14 @@ class ChallengeScheduleField extends Component {
117
117
timelines = null
118
118
return
119
119
}
120
-
121
120
var currentTime = moment ( ) . valueOf ( )
122
- var percentage = 30
121
+ var percentage = 0
123
122
if ( startDate . getTime ( ) > currentTime ) {
124
- percentage = 30
123
+ percentage = 0
125
124
} else if ( endDate . getTime ( ) > currentTime ) {
126
- percentage = Math . round ( ( ( currentTime - startDate . getTime ( ) ) / ( secondToMilisecond * p . duration ) ) * 100 )
125
+ percentage = Math . round ( ( ( currentTime - startDate . getTime ( ) ) / ( hourToMilisecond * p . duration ) ) * 100 )
127
126
} else {
128
- percentage = Math . round ( ( ( endDate . getTime ( ) - startDate . getTime ( ) ) / ( secondToMilisecond * p . duration ) ) * 100 )
127
+ percentage = Math . round ( ( ( endDate . getTime ( ) - startDate . getTime ( ) ) / ( hourToMilisecond * p . duration ) ) * 100 )
129
128
}
130
129
timelines . push (
131
130
[
You can’t perform that action at this time.
0 commit comments