From e80d52cc0f9eba355f4fdd039ed2d7ea35502cd8 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Mon, 29 Jul 2019 12:07:53 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B02416=20fix=20datepicker=20not=20opening?= =?UTF-8?q?=20anymore=20This=20was=20brought=20by=20PR=20#40=20integration?= =?UTF-8?q?=20in=2006592d7d37ae613d932bd3d100055a2abd8a0b36?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/itopwebpage.class.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index f63bed8af..28521c20e 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -238,7 +238,14 @@ EOF; // Time picker additional options $sUserLang = Dict::GetUserLanguage(); - $sTimePickerLang = json_encode(Dict::S('INTERNAL:JQuery-DatePicker:LangCode', $sUserLang)); + $sUserLangShort = strtolower( + substr($sUserLang, 0, 2) + ); + // PR #40 : we are picking correct values for specific cases in dict files + // some languages are using codes like zh-CN or pt-BR + $sTimePickerLang = json_encode( + Dict::S('INTERNAL:JQuery-DatePicker:LangCode', $sUserLangShort) + ); $aPickerOptions['showOn'] = ''; $aPickerOptions['buttonImage'] = null; $aPickerOptions['timeFormat'] = $oTimeFormat->ToDatePicker();