-
Notifications
You must be signed in to change notification settings - Fork 13
/
XEditableComboDate.php
109 lines (94 loc) · 2.19 KB
/
XEditableComboDate.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
/**
* XeditableText class file.
*
* @author Marcio Camello <[email protected]>
* @link http://
* @copyright Copyright © Marcio Camello 2014
* @version 1.5.1
*/
namespace mcms\xeditable;
class XEditableComboDate extends XEditable
{
/**
* @see Xeditable
* @var string
* Type of input. select
*/
public $type = 'combodate';
/**
* @see Xeditable
* @var object
* Configuration of combodate. Full list of options: http://vitalets.github.com/combodate/#docs
*/
public $combodate = null;
/**
* @see XEditable
* @var boolean|string
* Whether to show clear button
*/
public $clear = 'x clear';
/**
* @see XEditable
* @var object
* Configuration of datepicker. Full list of options: http://bootstrap-datepicker.readthedocs.org/en/latest/options.html
*/
public $datepicker = '{ }';
/**
* @see XEditable
* @var boolean
* If true - html will be escaped in content of element via $.text() method.
* If false - html will not be escaped, $.html() used.
* When you use own display function, this option obviosly has no effect.
*/
public $escape = true;
/**
* @see XEditable
* @var string
* CSS class automatically applied to input
*/
public $inputclass = null;
/**
* @see XEditable
* @var string
* Format used for sending value to server. Also applied when converting date from data-value attribute.
* See list of tokens in momentjs docs
*/
public $format = 'YYYY-MM-DD';
/**
* @see XEditable
* @var string
* Template used for displaying dropdowns.
*/
public $template = 'D / MMM / YYYY';
/**
* @see XEditable
* @var string
* Format used for displaying date. Also applied when converting date from element's text on init.
* If not specified equals to format
*/
public $viewformat = null;
/**
* @see XEditable
* @var string
* HTML template of input. Normally you should not change it.
*/
public $tpl = '<input type="text">';
/**
* @see Xeditable
* @see Init extension default
*/
public function init()
{
parent::init();
$this->registerAssets();
}
/**
* @see Xeditable
* @see Init extension default
*/
public function registerAssets()
{
ComboDateAsset::register($this->view);
}
}