diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2014-03-05 16:37:56 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2014-03-05 16:37:56 +0100 |
commit | ea78b729df40eeb0bd59feca08d6044e11f8e550 (patch) | |
tree | cddcd58cc9510ea6bfd2a68ca148a47671f3e22b /sonar-server/src/main/webapp/javascripts | |
parent | 78f565f3de6d5666b7618dfd81e2cd6919e7da80 (diff) | |
download | sonarqube-ea78b729df40eeb0bd59feca08d6044e11f8e550.tar.gz sonarqube-ea78b729df40eeb0bd59feca08d6044e11f8e550.zip |
SONAR-5083 Fix bug with restoring WORK_DUR from minutes
Diffstat (limited to 'sonar-server/src/main/webapp/javascripts')
-rw-r--r-- | sonar-server/src/main/webapp/javascripts/common/inputs.coffee | 2 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/javascripts/common/inputs.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/javascripts/common/inputs.coffee b/sonar-server/src/main/webapp/javascripts/common/inputs.coffee index bc65fd504dc..8f7f491e6b9 100644 --- a/sonar-server/src/main/webapp/javascripts/common/inputs.coffee +++ b/sonar-server/src/main/webapp/javascripts/common/inputs.coffee @@ -24,7 +24,7 @@ convertWorkDuration = (value) -> restoreWorkDuration = (value) -> - return value unless typeof value == 'number' + return value unless /^\d+$/.test value days = Math.floor(value / (8 * 60)) hours = Math.floor((value - days * 8 * 60) / 60) minutes = value % 60 diff --git a/sonar-server/src/main/webapp/javascripts/common/inputs.js b/sonar-server/src/main/webapp/javascripts/common/inputs.js index 2c22bd7310f..50607e1958e 100644 --- a/sonar-server/src/main/webapp/javascripts/common/inputs.js +++ b/sonar-server/src/main/webapp/javascripts/common/inputs.js @@ -28,7 +28,7 @@ restoreWorkDuration = function(value) { var days, hours, minutes, result; - if (typeof value !== 'number') { + if (!/^\d+$/.test(value)) { return value; } days = Math.floor(value / (8 * 60)); |