Changeset:
        d9cdf2b7aafb
        
https://sourceforge.net/p/mrbs/hg-code/ci/d9cdf2b7aafbac97c30e4b5ac277c785f8104b79
Author:
        Campbell Morrison <[email protected]>
Date:
        Wed Apr 12 17:29:34 2017 +0100
Log message:

Made period_time_string() consistent with period_date_string().

diffstat:

 web/functions.inc |  10 +++++-----
 web/month.php     |   6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (53 lines):

diff -r 86cc17606b3e -r d9cdf2b7aafb web/functions.inc
--- a/web/functions.inc Wed Apr 12 17:19:52 2017 +0100
+++ b/web/functions.inc Wed Apr 12 17:29:34 2017 +0100
@@ -2162,9 +2162,9 @@
 }
 
 
-function period_time_string($t, $mod_time=0)
+function period_time_string($t, $area_id, $mod_time=0)
 {
-  global $periods;
+  $period_names = get_period_names();
 
   $time = getdate($t);
   $p_num = $time["minutes"] + $mod_time;
@@ -2172,11 +2172,11 @@
   {
     $p_num = 0;
   }
-  if ( $p_num >= count($periods) - 1 )
+  if ( $p_num >= count($period_names[$area_id]) - 1 )
   {
-    $p_num = count($periods ) - 1;
+    $p_num = count($period_names[$area_id]) - 1;
   }
-  return $periods[$p_num];
+  return $period_names[$area_id][$p_num];
 }
 
 function time_date_string($t)
diff -r 86cc17606b3e -r d9cdf2b7aafb web/month.php
--- a/web/month.php     Wed Apr 12 17:19:52 2017 +0100
+++ b/web/month.php     Wed Apr 12 17:29:34 2017 +0100
@@ -29,7 +29,7 @@
 
 function get_booking_summary($start, $end, $day_start, $day_end)
 {
-  global $enable_periods;
+  global $enable_periods, $area;
   
   // Use ~ (not -) to separate the start and stop times, because MSIE
   // will incorrectly line break after a -.
@@ -42,8 +42,8 @@
   
   if ($enable_periods)
   {
-    $start_str = htmlspecialchars(period_time_string($start));
-    $end_str   = htmlspecialchars(period_time_string($end, -1));
+    $start_str = htmlspecialchars(period_time_string($start, $area));
+    $end_str   = htmlspecialchars(period_time_string($end, $area, -1));
   }
   else
   {

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to