Revision: 2479
          https://sourceforge.net/p/mrbs/code/2479/
Author:   cimorrison
Date:     2012-10-09 15:12:05 +0000 (Tue, 09 Oct 2012)
Log Message:
-----------
Fixed bug causing wrong date to be shown in the end date datepicker if the 
starttime was less than the duration away from the end of the booking day

Modified Paths:
--------------
    mrbs/branches/improved_repeat_interface/web/edit_entry.php

Modified: mrbs/branches/improved_repeat_interface/web/edit_entry.php
===================================================================
--- mrbs/branches/improved_repeat_interface/web/edit_entry.php  2012-10-09 
14:25:11 UTC (rev 2478)
+++ mrbs/branches/improved_repeat_interface/web/edit_entry.php  2012-10-09 
15:12:05 UTC (rev 2479)
@@ -86,16 +86,19 @@
 // is really the day before.
 function getbookingdate($t)
 {
-  global $eveningends, $eveningends_minutes;
+  global $eveningends, $eveningends_minutes, $resolution;
   
   $date = getdate($t);
-  if (day_past_midnight() &&
-      !hm_before(array('hours' => $eveningends, 'minutes' => 
$eveningends_minutes), $date))
+  
+  $t_secs = (($date['hours'] * 60) + $date['minutes']) * 60;
+  $e_secs = ((($eveningends * 60) + $eveningends_minutes) * 60) + $resolution;
+  if (day_past_midnight() && ($t_secs <= $e_secs))
   {
     $date = getdate(mktime($date['hours'], $date['minutes'], $date['seconds'],
                            $date['mon'], $date['mday'] -1, $date['year']));
     $date['hours'] += 24;
   }
+  
   return $date;
 }
 
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to