mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-41664 - Calendar: Add method for formating years in the new calendar plugin.
This commit is contained in:
parent
68291f2d57
commit
73412d9680
6 changed files with 101 additions and 61 deletions
|
@ -36,14 +36,8 @@ class profile_define_datetime extends profile_define_base {
|
|||
list($year, $month, $day) = explode('_', date('Y_m_d'));
|
||||
$currentdate = $calendartype->convert_from_gregorian($year, $month, $day);
|
||||
$currentyear = $currentdate['year'];
|
||||
$startyear = $calendartype->get_min_year();
|
||||
$endyear = $calendartype->get_max_year();
|
||||
|
||||
// Create array for the years.
|
||||
$arryears = array();
|
||||
for ($i = $startyear; $i <= $endyear; $i++) {
|
||||
$arryears[$i] = $i;
|
||||
}
|
||||
$arryears = $calendartype->get_years();
|
||||
|
||||
// Add elements.
|
||||
$form->addElement('select', 'param1', get_string('startyear', 'profilefield_datetime'), $arryears);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue