From 8a671525046655e057a15c6de9507834322b466d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 27 Apr 2019 17:02:25 +0000 Subject: [PATCH] Added a couple of clarifying comments. --- WEB-INF/lib/form/Calendar.class.php | 2 ++ WEB-INF/lib/ttTimeHelper.class.php | 5 +++++ WEB-INF/templates/footer.tpl | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index bd777ea9..447a45e0 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -126,6 +126,8 @@ class Calendar extends FormElement { $str .= ""; + // TODO: refactor this entire class, as $weekend_start and $weekend_end + // are not what their names suggest (debug with non zero week start to see it). $weekend_start = 6 - $this->weekStartDay; // Saturday by default. $weekend_end = (7 - $this->weekStartDay) % 7; // Sunday by default. if (defined('WEEKEND_START_DAY')) { diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 6fd816e0..57790e22 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -33,6 +33,11 @@ class ttTimeHelper { // isWeekend determines if $date falls on weekend. static function isWeekend($date) { + // NOTE: this does not work for subgroups with different WEEKEND_START_DAY + // as the setting is per server. Example: a parent group in USA, with a subgroup + // in Saudi Arabia. Their weekends are the same. + // Decided NOT to introduce a configurable WEEKEND_START_DAY for groups in UI + // to keep UI simple, for now. See also Calendar class with the same issue. $weekDay = date('w', strtotime($date)); return ($weekDay == WEEKEND_START_DAY || $weekDay == (WEEKEND_START_DAY + 1) % 7); } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 44dea7a7..343a4d04 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.19.4.4995 | Copyright © Anuko | +  Anuko Time Tracker 1.19.4.4996 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1