X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/96f2dabc7d64e28c74358fb5745a6c68b18527f3..d59576d22d6c7720c0078b3e17232c81bbaf9373:/js/common.js diff --git a/js/common.js b/js/common.js index 8ab2a5bc8..b4784f4b1 100644 --- a/js/common.js +++ b/js/common.js @@ -1,6 +1,6 @@ function setupPoints(numberformat, wrongFormat) { - decpoint = numberformat.substring((numberformat.substring(1, 2).match(/\.|\,/) ? 5 : 4), (numberformat.substring(1, 2).match(/\.|\,/) ? 6 : 5)); - if (numberformat.substring(1, 2).match(/\.|\,/)) { + decpoint = numberformat.substring((numberformat.substring(1, 2).match(/\.|\,|\'/) ? 5 : 4), (numberformat.substring(1, 2).match(/\.|\,|\'/) ? 6 : 5)); + if (numberformat.substring(1, 2).match(/\.|\,|\'/)) { thpoint = numberformat.substring(1, 2); } else { @@ -44,6 +44,9 @@ function check_right_number_format(input_name) { if(thpoint && thpoint == '.'){ test_val = test_val.replace(/\./g, ''); } + if(thpoint && thpoint == "'"){ + test_val = test_val.replace(/\'/g, ''); + } if(decpoint && decpoint == ','){ test_val = test_val.replace(/,/g, '.'); } @@ -70,7 +73,7 @@ function check_right_date_format(input_name) { // 31122014 -> 12.04.2014 // 12312014 -> 12/31/2014 // 31122014 -> 31/12/2014 - + if (input_name.value.match(/^\d{8}$/)) { input_name.value = input_name.value.replace(/^(\d\d)(\d\d)(\d\d\d\d)$/, "$1" + seperator + "$2" + seperator + "$3") } else if (input_name.value.match(/^\d{6}$/)) { @@ -90,7 +93,7 @@ function check_right_date_format(input_name) { var month = today.getMonth() + 1; var year = today.getYear(); if( day.length == 1 && day < 10) { - day='0'+day; + day='0'+day; }; if(month<10) { month='0'+month; @@ -100,7 +103,7 @@ function check_right_date_format(input_name) { input_name.value = day + seperator + month + seperator + year; } else { input_name.value = month + seperator + day + seperator + year; - } + } }; }