Fixded CM.Disp.GetTimeColor

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

No files matched your search

+12 -4
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);
if (time > 300) color = CM.Disp.colorRed;
else if (time > 60) color = CM.Disp.colorOrange;
else color = CM.Disp.colorYellow;
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};
}
+12 -4
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);
if (time > 300) color = CM.Disp.colorRed;
else if (time > 60) color = CM.Disp.colorOrange;
else color = CM.Disp.colorYellow;
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};
}