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.     // restrict selectable dates to weekdays in december 2007
  16.         $dp->selectableDatesRange array(
  17.         // this is for all the Mondays (December 3rd is a Monday and therefore every 7th day will be a monday)
  18.                 array(mktime(0001232007)mktime(00012312007)7),
  19.         // this is for the Tuesdays
  20.                 array(mktime(0001242007)mktime(00012312007)7),
  21.         // this is for the Wednesdays
  22.                 array(mktime(0001252007)mktime(00012312007)7),
  23.         // this is for the Thursdays
  24.                 array(mktime(0001262007)mktime(00012312007)7),
  25.         // and this is for the Fridays
  26.                 array(mktime(0001272007)mktime(00012312007)7),
  27.     )
  28.  
  29. ?>
  30.  
  31. <p>
  32.     Another example about restricting selectable dates...
  33. </p>
  34. <pre style="font-size:11px">
  35. // include the class
  36. require "../class.datepicker.php";
  37.  
  38. // instantiate the object
  39. $dp=new datepicker();
  40.  
  41. // restrict selectable dates to weekdays in december 2007
  42. $dp->selectableDatesRange = array(
  43.     // this is for all the Mondays (December 3rd is a Monday and therefore every 7th day will be a monday)
  44.     array(mktime(0, 0, 0, 12, 3, 2007), mktime(0, 0, 0, 12, 31, 2007), 7),
  45.     // this is for the Tuesdays
  46.     array(mktime(0, 0, 0, 12, 4, 2007), mktime(0, 0, 0, 12, 31, 2007), 7),
  47.     // this is for the Wednesdays
  48.     array(mktime(0, 0, 0, 12, 5, 2007), mktime(0, 0, 0, 12, 31, 2007), 7),
  49.     // this is for the Thursdays
  50.     array(mktime(0, 0, 0, 12, 6, 2007), mktime(0, 0, 0, 12, 31, 2007), 7),
  51.     // and this is for the Fridays
  52.     array(mktime(0, 0, 0, 12, 7, 2007), mktime(0, 0, 0, 12, 31, 2007), 7),
  53. )
  54.  
  55. &lt;input type="text" id="date">
  56.  
  57. &lt;input type="button" value="..." onclick="&lt;?=$dp->show("date")?>">
  58. </pre>
  59.  
  60. <p>Click on the button to see it work</p>
  61.  
  62. <input type="text" id="date">
  63.  
  64. <input type="button" value="..." onclick="<?=$dp->show("date")?>">
  65.  
  66. </body>
  67. </html>

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