From ea78b729df40eeb0bd59feca08d6044e11f8e550 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 5 Mar 2014 16:37:56 +0100 Subject: SONAR-5083 Fix bug with restoring WORK_DUR from minutes --- sonar-server/src/main/webapp/javascripts/common/inputs.coffee | 2 +- sonar-server/src/main/webapp/javascripts/common/inputs.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sonar-server/src') 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)); -- cgit v1.2.3