Fixded CM.Disp.GetTimeColor

This commit is contained in:
Daniel van Noord
2020-12-03 15:28:38 +01:00
parent 63c3a493fa
commit 95f19fbfd7
2 changed files with 24 additions and 8 deletions

View File

@@ -1188,10 +1188,18 @@ CM.Disp.FormatTime = function(time, longFormat) {
*/
CM.Disp.GetTimeColor = function(time) {
var color;
var text = CM.Disp.FormatTime(time);
var text;
if (time < 0) {
if (CM.Config.TimeFormat) text = '00:00:00:00:00';
else text = 'Done!';
color = CM.Disp.colorGreen;
}
else {
text = CM.Disp.FormatTime(time);
if (time > 300) color = CM.Disp.colorRed;
else if (time > 60) color = CM.Disp.colorOrange;
else color = CM.Disp.colorYellow;
}
return {text: text, color: color};
}

View File

@@ -313,10 +313,18 @@ CM.Disp.FormatTime = function(time, longFormat) {
*/
CM.Disp.GetTimeColor = function(time) {
var color;
var text = CM.Disp.FormatTime(time);
var text;
if (time < 0) {
if (CM.Config.TimeFormat) text = '00:00:00:00:00';
else text = 'Done!';
color = CM.Disp.colorGreen;
}
else {
text = CM.Disp.FormatTime(time);
if (time > 300) color = CM.Disp.colorRed;
else if (time > 60) color = CM.Disp.colorOrange;
else color = CM.Disp.colorYellow;
}
return {text: text, color: color};
}