Skip to content

Commit

Permalink
MDL-27562 formslib: applydst should be always true, hence option remo…
Browse files Browse the repository at this point in the history
…ved from dateselector and datetimeselector form elements
  • Loading branch information
Rajesh Taneja committed May 7, 2012
1 parent fa70f63 commit c106a9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions lib/form/dateselector.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group
* If not specified, then date is caclulated based on current user timezone.
* Note: dst will be calculated for string timezones only
* {@link http://docs.moodle.org/dev/Time_API#Timezone}
* applydst => apply users daylight savings adjustment?
* optional => if true, show a checkbox beside the date to turn it on (or off)
* @var array
*/
protected $_options = array('startyear' => 1970, 'stopyear' => 2020,
'timezone' => 99, 'applydst' => true, 'optional' => false);
'timezone' => 99, 'optional' => false);

/** @var array These complement separators, they are appended to the resultant HTML */
protected $_wrap = array('', '');
Expand Down Expand Up @@ -236,7 +235,7 @@ function exportValue(&$submitValues, $assoc = false)
$valuearray['day'],
0, 0, 0,
$this->_options['timezone'],
$this->_options['applydst']);
true);

return $value;
} else {
Expand Down
5 changes: 2 additions & 3 deletions lib/form/datetimeselector.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group{
* If not specified, then date is caclulated based on current user timezone.
* Note: dst will be calculated for string timezones only
* {@link http://docs.moodle.org/dev/Time_API#Timezone}
* applydst => apply users daylight savings adjustment?
* step => step to increment minutes by
* optional => if true, show a checkbox beside the date to turn it on (or off)
* @var array
*/
var $_options = array('startyear' => 1970, 'stopyear' => 2020, 'defaulttime' => 0,
'timezone' => 99, 'applydst' => true, 'step' => 5, 'optional' => false);
'timezone' => 99, 'step' => 5, 'optional' => false);

/** @var array These complement separators, they are appended to the resultant HTML */
var $_wrap = array('', '');
Expand Down Expand Up @@ -258,7 +257,7 @@ function exportValue(&$submitValues, $assoc = false)
$valuearray['minute'],
0,
$this->_options['timezone'],
$this->_options['applydst']);
true);

return $value;
} else {
Expand Down
2 changes: 0 additions & 2 deletions user/profile/field/datetime/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ function edit_field_add($mform) {
$attributes = array(
'startyear' => $this->field->param1,
'stopyear' => $this->field->param2,
'timezone' => 99,
'applydst' => true,
'optional' => $optional
);

Expand Down

0 comments on commit c106a9b

Please sign in to comment.