Revision: 2984
          https://sourceforge.net/p/mrbs/code/2984/
Author:   cimorrison
Date:     2015-01-26 18:20:56 +0000 (Mon, 26 Jan 2015)
Log Message:
-----------
Fixed bug preventing the booking date being changed when multi-day bookings are 
not allowed

Modified Paths:
--------------
    mrbs/trunk/web/js/edit_entry.js.php

Modified: mrbs/trunk/web/js/edit_entry.js.php
===================================================================
--- mrbs/trunk/web/js/edit_entry.js.php 2015-01-26 16:08:11 UTC (rev 2983)
+++ mrbs/trunk/web/js/edit_entry.js.php 2015-01-26 18:20:56 UTC (rev 2984)
@@ -1361,20 +1361,34 @@
   // Actions to take when the start and end datepickers are closed
   ?>
   $('#start_datepicker, #end_datepicker').bind('datePickerUpdated', function() 
{
+    
     <?php
-    // (1) Go and adjust the start and end time/period select options, because
+    // (1) If the end_datepicker isn't visible and we change the 
start_datepicker,
+    //     then set the end date to be the same as the start date.  (This will 
be
+    //     the case if multiday bookings are not allowed)
+    ?>
+    if ($(this).attr('id') === 'start_datepicker')
+    {
+      if ($('#end_datepicker').css('visibility') === 'hidden')
+      {
+        $('#end_datepicker_alt').val($('#start_datepicker_alt').val())
+      }
+    }
+    
+    <?php
+    // (2) Go and adjust the start and end time/period select options, because
     //     they are dependent on the start and end dates
     ?>
     adjustSlotSelectors();
     
     <?php
-    // (2) If we're doing Ajax checking of the form then we have to check
+    // (3) If we're doing Ajax checking of the form then we have to check
     //     for conflicts when the datepicker is closed
     ?>
     checkConflicts();
       
     <?php
-    // (3) Check to see whether any time slots should be removed from the time
+    // (4) Check to see whether any time slots should be removed from the time
     //     select on the grounds that they don't exist due to a transition 
into DST.
     ?>
     checkTimeSlots($(this));
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to