Revision: 2983
https://sourceforge.net/p/mrbs/code/2983/
Author: cimorrison
Date: 2015-01-26 16:08:11 +0000 (Mon, 26 Jan 2015)
Log Message:
-----------
Fixed theoretical bug
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 14:33:53 UTC (rev 2982)
+++ mrbs/trunk/web/js/edit_entry.js.php 2015-01-26 16:08:11 UTC (rev 2983)
@@ -762,35 +762,35 @@
function getDateDifference()
{
var diff,
- secondsPerDay = <?php echo SECONDS_PER_DAY ?>;
-
- <?php
- if (!$is_admin && $auth['only_admin_can_book_multiday'])
+ secondsPerDay = <?php echo SECONDS_PER_DAY ?>,
+ start = $('#start_datepicker_alt').val().split('-'),
+ startDate = new Date(parseInt(start[0], 10),
+ parseInt(start[1], 10) - 1,
+ parseInt(start[2], 10),
+ 12),
+ endDatepickerAlt = $('#end_datepicker_alt'),
+ end,
+ endDate;
+
+ if (endDatepickerAlt.length == 0)
{
+ <?php
+ // No end date selector, so assume the end date is
+ // the same as the start date
?>
diff = 0;
- <?php
}
else
{
- ?>
- var start = $('#start_datepicker_alt').val().split('-');
- var startDate = new Date(parseInt(start[0], 10),
- parseInt(start[1], 10) - 1,
- parseInt(start[2], 10),
- 12);
-
- var end = $('#end_datepicker_alt').val().split('-');
- var endDate = new Date(parseInt(end[0], 10),
- parseInt(end[1], 10) - 1,
- parseInt(end[2], 10),
- 12);
+ end = $('#end_datepicker_alt').val().split('-');
+ endDate = new Date(parseInt(end[0], 10),
+ parseInt(end[1], 10) - 1,
+ parseInt(end[2], 10),
+ 12);
diff = (endDate - startDate)/(secondsPerDay * 1000);
diff = Math.round(diff);
- <?php
}
- ?>
return diff;
}
------------------------------------------------------------------------------
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