From 6b7d0d3ec384b1fc91966730571b282978b5b336 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 26 Sep 2013 17:36:55 +0800 Subject: [PATCH] MDL-41792 core_form: used the new get_name() calendar function in the date selectors --- lib/form/dateselector.php | 4 ++-- lib/form/datetimeselector.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/form/dateselector.php b/lib/form/dateselector.php index 4e94b09360d..7676edbccdd 100644 --- a/lib/form/dateselector.php +++ b/lib/form/dateselector.php @@ -99,7 +99,7 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group { } } // The YUI2 calendar only supports the gregorian calendar type. - if (\core_calendar\type_factory::get_calendar_type() === 'gregorian') { + if ($calendartype->get_name() === 'gregorian') { form_init_date_js(); } } @@ -126,7 +126,7 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group { $this->_elements[] = @MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true); $this->_elements[] = @MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true); // The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used. - if (\core_calendar\type_factory::get_calendar_type() === 'gregorian') { + if ($calendartype->get_name() === 'gregorian') { $this->_elements[] = @MoodleQuickForm::createElement('image', 'calendar', $OUTPUT->pix_url('i/calendar', 'moodle'), array('title' => get_string('calendar', 'calendar'), 'class' => 'visibleifjs')); } diff --git a/lib/form/datetimeselector.php b/lib/form/datetimeselector.php index e3a908ec3df..f80f3566050 100644 --- a/lib/form/datetimeselector.php +++ b/lib/form/datetimeselector.php @@ -101,7 +101,7 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group { } } // The YUI2 calendar only supports the gregorian calendar type. - if (\core_calendar\type_factory::get_calendar_type() === 'gregorian') { + if ($calendartype->get_name() === 'gregorian') { form_init_date_js(); } } @@ -141,7 +141,7 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group { $this->_elements[] = @MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); } // The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used. - if (\core_calendar\type_factory::get_calendar_type() === 'gregorian') { + if ($calendartype->get_name() === 'gregorian') { $this->_elements[] = @MoodleQuickForm::createElement('image', 'calendar', $OUTPUT->pix_url('i/calendar', 'moodle'), array('title' => get_string('calendar', 'calendar'), 'class' => 'visibleifjs')); }