5 // see the demo at http://www.frequency-decoder.com/demo/date-picker-v4/
8 <script type="text/javascript" src="/plekit/datepicker/datepicker.js"></script>
9 <link href="/plekit/datepicker/datepicker.css" rel="stylesheet" type="text/css" />
13 // (*) inline (default=true)
14 // (*) format (default 2010/Jan/01), php-equiv. Y/M/d, which in this paradigm translates into Y-sl-m-sl-d
15 // (*) value : the value to display initially - default ''
17 class PlekitDatepicker {
21 function PlekitDatepicker ($id,$display,$options=NULL) {
22 $datepicker_default_options =
23 array ('inline'=>true,
24 'format'=>'Y-sl-M-sl-d',
26 if (!$options) $options=array();
28 $this->display=$display;
29 $this->options=array_merge($datepicker_default_options,$options);
34 $inline=$this->options['inline'];
35 $format=$this->options['format'];
36 $value=$this->options['value'];
39 $html .= "<label for='$this->id'>$this->display</label>";
40 $html .= "<input size=13 type='text'";
41 $html .= " class='dateformat-$format";
42 $html .= " opacity-60";
43 if ($inline) $html .= " display-inline";
44 $html .= "' id='$this->id' name='$this->id' value='$value' />";
49 // works for default format only for now
50 $this->options['value']=date('Y/M/d');