]> git.mjollnir.org Git - moodle.git/commitdiff
Modified handling of the first day of the week to default to the "firstdayofweek"
authordefacer <defacer>
Wed, 31 Mar 2004 07:18:32 +0000 (07:18 +0000)
committerdefacer <defacer>
Wed, 31 Mar 2004 07:18:32 +0000 (07:18 +0000)
language string value, according to Eloy's suggestion. Thanks for the tip! :)

calendar/lib.php

index 9810e2cc0add2b00af9b1ebe4abea4f505c54874..b5d68575b6b3afcca878b475514729ab27b10a1a 100644 (file)
 //                                                                         //
 /////////////////////////////////////////////////////////////////////////////
 
+$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) {