datePicker
[ class tree: datePicker ] [ index: datePicker ] [ all elements ]

example

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3.     <head>
  4.         <title>datepicker test</title>
  5.     </head>
  6. <body>
  7. <?php
  8.  
  9.     // include the class
  10.         require "../class.datepicker.php";
  11.  
  12.     // instantiate the object
  13.         $dp=new datepicker();
  14.     
  15.     // only allow selecting a year
  16.         $dp->selectableYearsRange array(
  17.         // between 2000 and current year minus 1
  18.                 array(2000date("Y"11),
  19.         // and also any year between 1990 and 1998
  20.                 array(199019981)
  21.     );
  22.     
  23.     // notice that you now have a select box for years!
  24.  
  25. ?>
  26.  
  27. <p>
  28.     Another example about restricting selectable dates...
  29. </p>
  30. <pre style="font-size:11px">
  31. &lt;?php
  32.  
  33. // include the class
  34. require "../class.datepicker.php";
  35.  
  36. // instantiate the object
  37. $dp=new datepicker();
  38.  
  39. // only allow selecting a year
  40. $dp->selectableYearsRange = array(
  41.     // between 2000 and current year minus 1
  42.     array(2000, date("Y") - 1, 1),
  43.     // and also any year between 1990 and 1998
  44.     array(1990, 1998, 1)
  45. );
  46.  
  47. // notice that you now have a select box for years!
  48.  
  49. ?&gt;
  50.  
  51. &lt;input type="text" id="date">
  52.  
  53. &lt;--
  54. also note below that we make current year minus 1 the default selected year because the current year not being in
  55. the selectable list, 1990 would've been the year selected by default
  56. --&gt;
  57.  
  58. &lt;input type="button" value="..." onclick="&lt;?=$dp->show("date", date("m") , date("Y") - 1)?>">
  59. </pre>
  60.  
  61. <p>Click on the button to see it work</p>
  62.  
  63. <input type="text" id="date">
  64.  
  65. <input type="button" value="..." onclick="<?=$dp->show("date"date("m")date("Y"1)?>">
  66.  
  67. </body>
  68. </html>

Documentation generated on Thu, 04 Sep 2008 10:13:49 +0300 by phpDocumentor 1.3.0RC6