When minutes or seconds zero, make string 00, fixes #188

This commit is contained in:
James Barnsley
2017-09-08 14:32:44 +12:00
parent 56e4c022b3
commit ac435919e7
3 changed files with 14 additions and 9 deletions

View File

@ -26,16 +26,17 @@ export default class Dater extends React.Component{
// get left-over number of seconds
seconds = total_seconds - ( total_minutes * 60 )
if( seconds <= 9 ) seconds = '0'+ seconds
if (seconds <= 9) seconds = '0'+ seconds
if (seconds == 0) seconds = '00'
// get left-over number of minutes
minutes = total_minutes - ( total_hours * 60 )
if( minutes <= 9 && total_hours ) minutes = '0'+ minutes
if( minutes == 0 ) minutes = '0'
if (minutes <= 9 && total_hours) minutes = '0'+ minutes
if (minutes == 0) minutes = '00'
if( total_hours ) string += total_hours+':'
if( minutes ) string += minutes+':'
if( seconds ) string += seconds
if (total_hours) string += total_hours+':'
if (minutes) string += minutes+':'
if (seconds) string += seconds
return string
}

View File

@ -40,9 +40,9 @@ export default class Notifications extends React.Component{
renderProcess(process){
var progress = ((process.data.total - process.data.remaining) / process.data.total * 100).toFixed()
if (isNaN(progress)){
progress = 0
var progress = 0;
if (process.data.total && process.data.remaining){
progress = ((process.data.total - process.data.remaining) / process.data.total * 100).toFixed()
}
switch (process.status){

View File

@ -138,6 +138,10 @@
bottom: 2px;
left: 60px;
right: 60px;
.progress {
@include animate(1s, linear);
}
}
.current {