diff --git a/openslides/core/static/css/app.css b/openslides/core/static/css/app.css index 32f6aa0e0..d278a6923 100644 --- a/openslides/core/static/css/app.css +++ b/openslides/core/static/css/app.css @@ -458,6 +458,10 @@ img { padding-right: 10px; } +.col2 .countdown_timer.negative { + color: #CC0000; +} + .col2 .notNull { color: red; font-weight: bold; diff --git a/openslides/core/static/js/core/base.js b/openslides/core/static/js/core/base.js index f850e8cd7..59201377e 100644 --- a/openslides/core/static/js/core/base.js +++ b/openslides/core/static/js/core/base.js @@ -333,25 +333,22 @@ angular.module('OpenSlidesApp.core', [ function () { return function (totalseconds) { var time; - var total = Math.abs(totalseconds); - if (parseInt(totalseconds)) { - var hh = Math.floor(total / 3600); - var mm = Math.floor(total % 3600 / 60); - var ss = Math.floor(total % 60); - var zero = "0"; - // Add leading "0" for double digit values - hh = (zero+hh).slice(-2); - mm = (zero+mm).slice(-2); - ss = (zero+ss).slice(-2); - if (hh == "00") - time = mm + ':' + ss; - else - time = hh + ":" + mm + ":" + ss; - if (totalseconds < 0) - time = "-"+time; - } else { - time = "--:--"; - } + // floor returns the largest integer of the absolut value of totalseconds + var total = Math.floor(Math.abs(totalseconds)); + var hh = Math.floor(total / 3600); + var mm = Math.floor(total % 3600 / 60); + var ss = Math.floor(total % 60); + var zero = "0"; + // Add leading "0" for double digit values + hh = (zero+hh).slice(-2); + mm = (zero+mm).slice(-2); + ss = (zero+ss).slice(-2); + if (hh == "00") + time = mm + ':' + ss; + else + time = hh + ":" + mm + ":" + ss; + if (totalseconds < 0) + time = "-"+time; return time; }; } diff --git a/openslides/core/static/templates/core/slide_countdown.html b/openslides/core/static/templates/core/slide_countdown.html index 17949e128..6fcb54ad3 100644 --- a/openslides/core/static/templates/core/slide_countdown.html +++ b/openslides/core/static/templates/core/slide_countdown.html @@ -1,6 +1,6 @@
-
+
{{ seconds | osSecondsToTime}}
{{ description }}