MDL-34708 Forms library : Fixed incorrect calendar day displayed across timezones. Credit to Matthew Davidson and team at rose-hulman.edu.

This commit is contained in:
Aparup Banerjee 2012-08-05 23:27:31 +08:00
parent 470d47f512
commit f597dcc008

View File

@ -81,25 +81,25 @@ function form_init_date_js() {
$function = 'M.form.dateselector.init_date_selectors';
$config = array(array(
'firstdayofweek' => get_string('firstdayofweek', 'langconfig'),
'mon' => strftime('%a', 360000), // 5th Jan 1970 at 12pm
'tue' => strftime('%a', 446400),
'wed' => strftime('%a', 532800),
'thu' => strftime('%a', 619200),
'fri' => strftime('%a', 705600),
'sat' => strftime('%a', 792000),
'sun' => strftime('%a', 878400),
'january' => strftime('%B', 14400), // 1st Jan 1970 at 12pm
'february' => strftime('%B', 2692800),
'march' => strftime('%B', 5112000),
'april' => strftime('%B', 7790400),
'may' => strftime('%B', 10382400),
'june' => strftime('%B', 13060800),
'july' => strftime('%B', 15652800),
'august' => strftime('%B', 18331200),
'september' => strftime('%B', 21009600),
'october' => strftime('%B', 23601600),
'november' => strftime('%B', 26280000),
'december' => strftime('%B', 28872000)
'mon' => strftime('%a', strtotime("Monday")), // 5th Jan 1970 at 12pm
'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")), // 1st Jan 1970 at 12pm
'february' => strftime('%B', strtotime("February")),
'march' => strftime('%B', strtotime("March")),
'april' => strftime('%B', strtotime("April")),
'may' => strftime('%B', strtotime("May")),
'june' => strftime('%B', strtotime("June")),
'july' => strftime('%B', strtotime("July")),
'august' => strftime('%B', strtotime("August")),
'september' => strftime('%B', strtotime("September")),
'october' => strftime('%B', strtotime("October")),
'november' => strftime('%B', strtotime("November")),
'december' => strftime('%B', strtotime("December"))
));
$PAGE->requires->yui_module($module, $function, $config);
$done = true;