Commit 68c10746 authored by Andrew Nicols's avatar Andrew Nicols
Browse files

Merge branch 'wip-mdl-53701' of https://github.com/rajeshtaneja/moodle

parents a9e9f963 45fb8b59
......@@ -80,27 +80,29 @@ function form_init_date_js() {
$calendar = \core_calendar\type_factory::get_calendar_instance();
$module = 'moodle-form-dateselector';
$function = 'M.form.dateselector.init_date_selectors';
$defaulttimezone = date_default_timezone_get();
$config = array(array(
'firstdayofweek' => $calendar->get_starting_weekday(),
'mon' => strftime('%a', strtotime("Monday")),
'tue' => strftime('%a', strtotime("Tuesday")),
'wed' => strftime('%a', strtotime("Wednesday")),
'thu' => strftime('%a', strtotime("Thursday")),
'fri' => strftime('%a', strtotime("Friday")),
'sat' => strftime('%a', strtotime("Saturday")),
'sun' => strftime('%a', strtotime("Sunday")),
'january' => strftime('%B', strtotime("January 1")),
'february' => strftime('%B', strtotime("February 1")),
'march' => strftime('%B', strtotime("March 1")),
'april' => strftime('%B', strtotime("April 1")),
'may' => strftime('%B', strtotime("May 1")),
'june' => strftime('%B', strtotime("June 1")),
'july' => strftime('%B', strtotime("July 1")),
'august' => strftime('%B', strtotime("August 1")),
'september' => strftime('%B', strtotime("September 1")),
'october' => strftime('%B', strtotime("October 1")),
'november' => strftime('%B', strtotime("November 1")),
'december' => strftime('%B', strtotime("December 1"))
'mon' => date_format_string(strtotime("Monday"), '%a', $defaulttimezone),
'tue' => date_format_string(strtotime("Tuesday"), '%a', $defaulttimezone),
'wed' => date_format_string(strtotime("Wednesday"), '%a', $defaulttimezone),
'thu' => date_format_string(strtotime("Thursday"), '%a', $defaulttimezone),
'fri' => date_format_string(strtotime("Friday"), '%a', $defaulttimezone),
'sat' => date_format_string(strtotime("Saturday"), '%a', $defaulttimezone),
'sun' => date_format_string(strtotime("Sunday"), '%a', $defaulttimezone),
'january' => date_format_string(strtotime("January 1"), '%B', $defaulttimezone),
'february' => date_format_string(strtotime("February 1"), '%B', $defaulttimezone),
'march' => date_format_string(strtotime("March 1"), '%B', $defaulttimezone),
'april' => date_format_string(strtotime("April 1"), '%B', $defaulttimezone),
'may' => date_format_string(strtotime("May 1"), '%B', $defaulttimezone),
'june' => date_format_string(strtotime("June 1"), '%B', $defaulttimezone),
'july' => date_format_string(strtotime("July 1"), '%B', $defaulttimezone),
'august' => date_format_string(strtotime("August 1"), '%B', $defaulttimezone),
'september' => date_format_string(strtotime("September 1"), '%B', $defaulttimezone),
'october' => date_format_string(strtotime("October 1"), '%B', $defaulttimezone),
'november' => date_format_string(strtotime("November 1"), '%B', $defaulttimezone),
'december' => date_format_string(strtotime("December 1"), '%B', $defaulttimezone)
));
$PAGE->requires->yui_module($module, $function, $config);
$done = true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment