Skip to content

Commit

Permalink
Fixed issue #11328: unable to select mandatory date field if the surv…
Browse files Browse the repository at this point in the history
…ey is viewed in Arabic Language
  • Loading branch information
olleharstedt committed Jun 3, 2016
1 parent a6129e1 commit 19369a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -8586,6 +8586,17 @@ static function ProcessCurrentResponses()
switch($type) // fix value before set it in $_SESSION : the data is reset when show it again to user.trying to save in DB : date only, but think it must be leave like it and filter oinly when save in DB
{
case 'D': //DATE

// Handle Arabic numerals
// TODO: Make a wrapper class around date converter, which constructor takes to-lang and from-lang
$lang = $_SESSION['LEMlang'];
if ($lang == 'ar')
{
$standard = array("0","1","2","3","4","5","6","7","8","9");
$eastern_arabic_symbols = array("٠","١","٢","٣","٤","٥","٦","٧","٨","٩");
$value = str_replace($eastern_arabic_symbols, $standard, $value);
}

$value=trim($value);
if ($value!="" && $value!="INVALID")
{
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/qanda_helper.php
Expand Up @@ -1114,7 +1114,7 @@ function do_date($ia)
'maxdate' => $maxdate,
'dateformatdetails' => $dateformatdetails['dateformat'],
'dateformatdetailsjs' => $dateformatdetails['jsdate'],
'goodchars' => "return goodchars(event,'".$goodchars."')",
'goodchars' => "", // "return goodchars(event,'".$goodchars."')", // This won't work with non-latin keyboards
'checkconditionFunction' => $checkconditionFunction.'(this.value, this.name, this.type)',
'language' => App()->language,
'hidetip' => trim($aQuestionAttributes['hide_tip'])==0,
Expand Down

0 comments on commit 19369a6

Please sign in to comment.