From 201816346877bde81b2673908efd2bb598fdccf5 Mon Sep 17 00:00:00 2001 From: Aparup Banerjee Date: Sun, 5 Aug 2012 23:27:31 +0800 Subject: [PATCH] MDL-34708 Forms library : Fixed incorrect calendar day displayed across timezones. Credit to Matthew Davidson and team at rose-hulman.edu. --- lib/formslib.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/formslib.php b/lib/formslib.php index 77b960e0b68..31a54191534 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -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;