Skip to content

Commit

Permalink
Fixed issue #10274: bad layout of mini calendar in statistics
Browse files Browse the repository at this point in the history
Dev: DatePicker in data entry view.
  • Loading branch information
olleharstedt committed Apr 22, 2016
1 parent 274cae4 commit bb4475a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion application/controllers/admin/dataentry.php
Expand Up @@ -733,7 +733,6 @@ public function editdata($subaction, $id, $surveyid, $language='')
/*
$aDataentryoutput .= Yii::app()->getController()->widget('yiiwheels.widgets.daterangepicker.WhDateRangePicker', array(
'name' => $fname['fieldname'],
'id' => 'datestampL',
'value' => $thisdate,
'pluginOptions' => array(
'format' => $dateformatdetails['jsdate'] . " HH:mm",
Expand Down
16 changes: 12 additions & 4 deletions application/views/admin/dataentry/content_view.php
Expand Up @@ -55,10 +55,18 @@
?>
<div class="col-sm-10">
<?php if(canShowDatePicker($dateformatdetails)): ?>
<?php
$goodchars = str_replace( array("m","d","y", "H", "M"), "", $dateformatdetails['dateformat']);
$goodchars = "0123456789".$goodchars[0]; ?>
<input type='text' class='popupdate' size='12' name='<?php echo $fieldname; ?>' onkeypress="return goodchars(event,'<?php echo $goodchars; ?>')"/>
<?php Yii::app()->getController()->widget('yiiwheels.widgets.daterangepicker.WhDateRangePicker', array(
'name' => $fieldname,
'pluginOptions' => array(
'format' => $dateformatdetails['jsdate'] . " HH:mm",
'singleDatePicker' => true,
'startDate' => date("Y-m-d", time()),
'drops' => 'up', // TODO: Does not work. Why?
'timePicker' => true,
'timePicker12Hour' => false, // NB: timePicker24Hour = true does not work
'timePickerIncrement' => 1
)
)); ?>
<input type='hidden' name='dateformat<?php echo $fieldname; ?>' id='dateformat<?php echo $fieldname; ?>' value='<?php echo $dateformatdetails['jsdate']; ?>' />
<?php else:?>
<input type='text' name='<?php echo $fieldname; ?>'/>
Expand Down

0 comments on commit bb4475a

Please sign in to comment.