1 <?php
2
3 /*
4 * This file is part of the Brickrouge package.
5 *
6 * (c) Olivier Laviale <olivier.laviale@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Brickrouge;
13
14 class Date extends Text
15 {
16 public function __construct($tags, $dummy=null)
17 {
18 parent::__construct
19 (
20 $tags + array
21 (
22 'size' => 16,
23 'class' => 'date'
24 )
25 );
26 }
27
28 public function __toString()
29 {
30 $value = (string) $this['value'];
31
32 if (!(int) $value)
33 {
34 $this['value'] = null;
35 }
36
37 return parent::__toString();
38 }
39
40 /*
41 static protected function add_assets(\Brickrouge\Document $document)
42 {
43 parent::add_assets($document);
44
45 $document->js->add(ASSETS . 'element/datepicker/datepicker.js');
46 $document->js->add(ASSETS . 'element/datepicker/auto.js');
47
48 $document->css->add(ASSETS . 'element/datepicker/calendar-eightysix-v1.1-default.css');
49 $document->css->add(ASSETS . 'element/datepicker/calendar-eightysix-v1.1-osx-dashboard.css');
50 }
51 */
52 }