Skip to content

Commit

Permalink
Merge branch 'wip-mdl-53701' of https://github.com/rajeshtaneja/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed May 6, 2016
2 parents a9e9f96 + 45fb8b5 commit 68c1074
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions lib/formslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 68c1074

Please sign in to comment.