Revision: 1900
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1900&view=rev
Author:   cimorrison
Date:     2011-08-28 19:11:34 +0000 (Sun, 28 Aug 2011)
Log Message:
-----------
Made the date range for the date selectors a config variable (default +/- 5 
years as at present)

Modified Paths:
--------------
    mrbs/trunk/web/functions.inc
    mrbs/trunk/web/systemdefaults.inc.php

Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc        2011-08-28 07:48:02 UTC (rev 1899)
+++ mrbs/trunk/web/functions.inc        2011-08-28 19:11:34 UTC (rev 1900)
@@ -437,7 +437,7 @@
 // and partly because it's easier to do this for the non-JavaScript version.
 function genDateSelector($prefix, $day, $month, $year, $form_id='')
 {
-  global $strftime_format;
+  global $strftime_format, $year_range;
   
   // Make sure we've got a date
   if (empty($day) or empty($month) or empty($year))
@@ -457,8 +457,8 @@
   $month_js = $month - 1;
   
   // First and last dates to show in year select
-  $min = min($year, date("Y")) - 5;
-  $max = max($year, date("Y")) + 5;
+  $min = min($year, date("Y")) - $year_range['back'];
+  $max = max($year, date("Y")) + $year_range['ahead'];
   
   $datepicker_baseid = "${prefix}datepicker";
   

Modified: mrbs/trunk/web/systemdefaults.inc.php
===================================================================
--- mrbs/trunk/web/systemdefaults.inc.php       2011-08-28 07:48:02 UTC (rev 
1899)
+++ mrbs/trunk/web/systemdefaults.inc.php       2011-08-28 19:11:34 UTC (rev 
1900)
@@ -261,6 +261,10 @@
 // in 24 hour format
 $twentyfourhour_format = 1;
 
+// The number of years back and ahead the date selectors should go
+$year_range['back'] = 5;
+$year_range['ahead'] = 5;
+
 // Formats used for dates and times.   For formatting options
 // see http://php.net/manual/function.strftime.php
 $strftime_format['date']         = "%A %d %B %Y";  // Used in Day view

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to