Skip to content

Commit

Permalink
Fixed issue #7276: Question type date/time does not handle time corre…
Browse files Browse the repository at this point in the history
…ctly with popup calendar
  • Loading branch information
c-schmitz committed Feb 16, 2013
1 parent 5ea835a commit 290b1ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/helpers/qanda_helper.php
Expand Up @@ -1327,9 +1327,10 @@ function do_date($ia)

$goodchars = str_replace( array("m","d","y"), "", $dateformatdetails['jsdate']);
$goodchars = "0123456789".substr($goodchars,0,1);
$iLength=strlen($dateformatdetails['dateformat']);

$answer ="<p class='question answer-item text-item date-item'><label for='answer{$ia[1]}' class='hide label'>{$clang->gT('Date picker')}</label>
<input class='popupdate' type=\"text\" size=\"10\" name=\"{$ia[1]}\" title='".sprintf($clang->gT('Format: %s'),$dateformatdetails['dateformat'])."' id=\"answer{$ia[1]}\" value=\"$dateoutput\" maxlength=\"10\" onkeypress=\"return goodchars(event,'".$goodchars."')\" onchange=\"$checkconditionFunction(this.value, this.name, this.type)\" />
<input class='popupdate' type=\"text\" size=\"{$iLength}\" name=\"{$ia[1]}\" title='".sprintf($clang->gT('Format: %s'),$dateformatdetails['dateformat'])."' id=\"answer{$ia[1]}\" value=\"$dateoutput\" maxlength=\"{$iLength}\" onkeypress=\"return goodchars(event,'".$goodchars."')\" onchange=\"$checkconditionFunction(this.value, this.name, this.type)\" />
<input type='hidden' name='dateformat{$ia[1]}' id='dateformat{$ia[1]}' value='{$dateformatdetails['jsdate']}' />
<input type='hidden' name='datelanguage{$ia[1]}' id='datelanguage{$ia[1]}' value='{$clang->langcode}' />
<input type='hidden' name='dateyearrange{$ia[1]}' id='dateyearrange{$ia[1]}' value='{$minyear}:{$maxyear}' />
Expand Down
2 changes: 2 additions & 0 deletions scripts/date.js
Expand Up @@ -3,6 +3,8 @@ $(document).ready(function(){
$(".popupdate").each(function(i,e) {
var basename = e.id.substr(6);
format=$('#dateformat'+basename).val();
format=format.replace(/H/gi,"0");
format=format.replace(/N/gi,"0");
language=$('#datelanguage'+basename).val();
yearrange=$('#dateyearrange'+basename).val();
range=yearrange.split(':');
Expand Down

0 comments on commit 290b1ca

Please sign in to comment.