From: defacer Date: Wed, 31 Mar 2004 07:18:32 +0000 (+0000) Subject: Modified handling of the first day of the week to default to the "firstdayofweek" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ed151929e3ad616369e8632e211bfbbaa9a76e16;p=moodle.git Modified handling of the first day of the week to default to the "firstdayofweek" language string value, according to Eloy's suggestion. Thanks for the tip! :) --- diff --git a/calendar/lib.php b/calendar/lib.php index 9810e2cc0a..b5d68575b6 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -38,10 +38,17 @@ // // ///////////////////////////////////////////////////////////////////////////// +$firstday = get_string('firstdayofweek'); +if(!is_numeric($firstday)) { + define ('CALENDAR_STARTING_WEEKDAY', 1); +} +else { + define ('CALENDAR_STARTING_WEEKDAY', intval($firstday) % 7); +} + define ('SECS_IN_DAY', 86400); define ('CALENDAR_UPCOMING_DAYS', 14); define ('CALENDAR_UPCOMING_MAXEVENTS', 10); -define ('CALENDAR_STARTING_WEEKDAY', 1); define ('CALENDAR_URL', $CFG->wwwroot.'/calendar/'); function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_year = false) {