Changeset:
        f05820862a08
        
https://sourceforge.net/p/mrbs/hg-code/ci/f05820862a08f1a6bc026ad1ff66590afe93f66e
Author:
        Campbell Morrison <cimorri...@hg.code.sf.net>
Date:
        Wed Mar 15 09:42:30 2017 +0000
Log message:

Added new config variable $weekdays to define weekdays and weekends, allowing
for the possibility that weekdays are not the same as woreking days.

diffstat:

 web/functions.inc          |  11 ++---------
 web/systemdefaults.inc.php |   3 +++
 2 files changed, 5 insertions(+), 9 deletions(-)

diffs (35 lines):

diff -r 3c25afbae66d -r f05820862a08 web/functions.inc
--- a/web/functions.inc Wed Mar 15 09:23:32 2017 +0000
+++ b/web/functions.inc Wed Mar 15 09:42:30 2017 +0000
@@ -2798,16 +2798,9 @@
 // checks whether a given day of the week is a weekend day
 function is_weekend($dow)
 {
-  global $working_days;
+  global $weekdays;
   
-  // We are using $working_days to define weekdays and therefore weekend
-  // days. This may not be correct as people might want to define a weekend
-  // day (eg Saturday) to be a working day.
-  
-  // An alternative could be to use IntlCalendar::getDayOfWeekType(), but
-  // that isn't available on all systems.
-  
-  return !in_array($dow, $working_days);
+  return !in_array($dow, $weekdays);
 }
 
 
diff -r 3c25afbae66d -r f05820862a08 web/systemdefaults.inc.php
--- a/web/systemdefaults.inc.php        Wed Mar 15 09:23:32 2017 +0000
+++ b/web/systemdefaults.inc.php        Wed Mar 15 09:42:30 2017 +0000
@@ -283,6 +283,9 @@
 // Start of week: 0 for Sunday, 1 for Monday, etc.
 $weekstarts = 0;
 
+// Days of the week that are weekdays
+$weekdays = array(1, 2, 3, 4, 5);
+
 // Days of the week that should be hidden from display
 // 0 for Sunday, 1 for Monday, etc.
 // For example, if you want Saturdays and Sundays to be hidden set 
$hidden_days = array(0,6);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
Mrbs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to