From ed151929e3ad616369e8632e211bfbbaa9a76e16 Mon Sep 17 00:00:00 2001 From: defacer Date: Wed, 31 Mar 2004 07:18:32 +0000 Subject: [PATCH] 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! :) --- calendar/lib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) { -- 2.39.5