From: Sven Schöling Date: Thu, 12 Oct 2017 13:55:35 +0000 (+0200) Subject: setupPoints und setupDateFormat entfernt X-Git-Tag: release-3.5.4~704 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=36e2bf671463dc06a6172735ae410d340bab78b0;p=kivitendo-erp.git setupPoints und setupDateFormat entfernt --- diff --git a/js/common.js b/js/common.js index 4959aca1c..ee4737b6e 100644 --- a/js/common.js +++ b/js/common.js @@ -1,26 +1,3 @@ -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(/\.|\,|\'/)) { - thpoint = numberformat.substring(1, 2); - } - else { - thpoint = null; - } - wrongNumberFormat = wrongFormat + " ( " + numberformat + " ) "; -} - -function setupDateFormat(setDateFormat, setWrongDateFormat) { - dateFormat = setDateFormat; - wrongDateFormat = setWrongDateFormat + " ( " + setDateFormat + " ) "; - formatArray = new Array(); - if(dateFormat.match(/^\w\w\W/)) { - seperator = dateFormat.substring(2,3); - } - else { - seperator = dateFormat.substring(4,5); - } -} - function centerParms(width,height,extra) { xPos = (screen.width - width) / 2; yPos = (screen.height - height) / 2; @@ -34,6 +11,9 @@ function centerParms(width,height,extra) { } function check_right_number_format(input_name) { + var decpoint = kivi._number_format.decimalSep; + var thpoint = kivi._number_format.thousandSep; + var test_val = input_name.value; if(thpoint && thpoint == ','){ test_val = test_val.replace(/,/g, ''); @@ -67,6 +47,9 @@ function check_right_date_format(input_name) { return true; } + var dateFormat = kivi.myconfig.dateformat; + var seperator = kivi._date_format.sep; + if ( ( input_name.value.match(/^\d+$/ ) ) && !(dateFormat.lastIndexOf("y") == 3) ) { // date shortcuts for entering date without separator for three date styles, e.g. // 31122014 -> 12.04.2014 diff --git a/templates/webpages/layout/javascript_setup.js b/templates/webpages/layout/javascript_setup.js index 8deb9e945..3481502d5 100644 --- a/templates/webpages/layout/javascript_setup.js +++ b/templates/webpages/layout/javascript_setup.js @@ -3,9 +3,6 @@ [%- USE JSON %] kivi.myconfig = [% JSON.json(MYCONFIG) %]; $(function() { - setupPoints(kivi.myconfig.numberformat, '[% JavaScript.escape(LxERP.t8("wrongformat")) %]'); - setupDateFormat(kivi.myconfig.dateformat, '[% JavaScript.escape(LxERP.t8("Falsches Datumsformat!")) %]'); - $.datepicker.setDefaults( $.extend({}, $.datepicker.regional[kivi.myconfig.countrycode], { dateFormat: kivi.myconfig.dateformat.replace(/d+/gi, 'dd').replace(/m+/gi, 'mm').replace(/y+/gi, 'yy'),