diff --git a/application/core/QuestionTypes/Date/RenderDate.php b/application/core/QuestionTypes/Date/RenderDate.php index 4948814b8a6..10f4a192e82 100644 --- a/application/core/QuestionTypes/Date/RenderDate.php +++ b/application/core/QuestionTypes/Date/RenderDate.php @@ -398,7 +398,7 @@ public function render($sCoreClasses = '') { $answer = ''; $inputnames = []; - $this->aDateformatDetails = getDateFormatDataForQID($this->aQuestionAttributes, $this->oQuestion->sid); + $this->aDateformatDetails = getDateFormatDataForQID($this->aQuestionAttributes, $this->oQuestion->sid, App()->language); $coreClass = "ls-answers answer-item date-item " . $sCoreClasses; $this->setMinDate(); $this->setMaxDate(); diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php index 38489928ec9..0b767a42184 100644 --- a/application/helpers/expressions/em_manager_helper.php +++ b/application/helpers/expressions/em_manager_helper.php @@ -9594,14 +9594,14 @@ public static function convertNonLatinNumerics($str, $lang) $standard = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; if ($lang == 'ar') { - $eastern_arabic_symbols = ["٠", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩"]; + $eastern_arabic_symbols = ["\u{0660}","\u{0661}","\u{0662}","\u{0663}","\u{0664}","\u{0665}","\u{0666}","\u{0667}","\u{0668}","\u{0669}"]; $result = str_replace($eastern_arabic_symbols, $standard, $str); } elseif ($lang == 'fa') { // NOTE: NOT the same UTF-8 letters as array above (Arabic) - $extended_arabic_indic = ["۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹"]; + $extended_arabic_indic = ["\u{06F0}","\u{06F1}","\u{06F2}","\u{06F3}","\u{06F4}","\u{06F5}","\u{06F6}","\u{06F7}","\u{06F8}","\u{06F9}"]; $result = str_replace($extended_arabic_indic, $standard, $str); } elseif ($lang == 'hi') { - $hindi_symbols = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"]; + $hindi_symbols = ["\u{0966}","\u{0967}","\u{0968}","\u{0969}","\u{096A}","\u{096B}","\u{096C}","\u{096D}","\u{096E}","\u{096F}"]; $result = str_replace($hindi_symbols, $standard, $str); } diff --git a/application/helpers/surveytranslator_helper.php b/application/helpers/surveytranslator_helper.php index 7a0d3c82ec7..65c6325f25e 100644 --- a/application/helpers/surveytranslator_helper.php +++ b/application/helpers/surveytranslator_helper.php @@ -1084,7 +1084,7 @@ function getJSDateFromDateFormat($sDateformat) * @returns array * */ -function getDateFormatDataForQID($aQidAttributes, $mThisSurvey) +function getDateFormatDataForQID($aQidAttributes, $mThisSurvey, $language = '') { if (isset($aQidAttributes['date_format']) && trim($aQidAttributes['date_format']) != '') { $aDateFormatDetails = array(); @@ -1094,7 +1094,7 @@ function getDateFormatDataForQID($aQidAttributes, $mThisSurvey) $aDateFormatDetails['jsdate_original'] = $aDateFormatDetails['dateformat']; // In dropdown, this is fed to Date in Javascript, not Bootstrap } else { if (!is_array($mThisSurvey)) { - $mThisSurvey = array('surveyls_dateformat' => getDateFormatForSID($mThisSurvey)); + $mThisSurvey = array('surveyls_dateformat' => getDateFormatForSID($mThisSurvey, $language)); } $aDateFormatDetails = getDateFormatData($mThisSurvey['surveyls_dateformat']); }