-
Improvement
-
Resolution: Duplicate
-
Minor
-
None
-
2.7.4
-
MOODLE_27_STABLE
The 'duration' form element (as defined in /lib/form/duration.php) can only be used to select weeks, days, hours, minutes and seconds as units of time.
It should be straightforward to allow alternative units to be provided via the options argument.
The form element would be more useful if you could supply your preferred units like this:
$units = array( |
YEARSECS => get_string('years'), |
DAYSECS * 30 => get_string('months'), |
DAYSECS => get_string('days') |
);
|
$options = array ('units' => $units); |
$mform->addElement('duration', 'lengthofexperience', 'name', $options); |