* Control the fieldnames for form elements
* startyear => int start of range of years that can be selected
* stopyear => int last year that can be selected
- * timezone => float/string timezone
+ * timezone => int|float|string (optional) timezone modifier used for edge case only.
+ * 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
$value = time();
}
if (!is_array($value)) {
- $currentdate = usergetdate($value);
+ $currentdate = usergetdate($value, $this->_options['timezone']);
$value = array(
'day' => $currentdate['mday'],
'month' => $currentdate['mon'],
* startyear => int start of range of years that can be selected
* stopyear => int last year that can be selected
* defaulttime => default time value if the field is currently not set
- * timezone => float/string timezone
+ * timezone => int|float|string (optional) timezone modifier used for edge case only.
+ * 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)
}
}
if (!is_array($value)) {
- $currentdate = usergetdate($value);
+ $currentdate = usergetdate($value, $this->_options['timezone']);
// Round minutes to the previous multiple of step.
$currentdate['minutes'] -= $currentdate['minutes'] % $this->_options['step'];
$value = array(