forked from marciocamello/yii2-x-editable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXEditableDateTime.php
105 lines (89 loc) · 2.01 KB
/
XEditableDateTime.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
<?php
/**
* XeditableText class file.
*
* @author Marcio Camello <marciocamello@outlook.com>
* @link http://
* @copyright Copyright © Marcio Camello 2014
* @version 1.5.1
*/
namespace mcms\xeditable;
class XEditableDateTime extends XEditable
{
/**
* @see Xeditable
* @var string
* Type of input. select
*/
public $type = 'datetime';
/**
* @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.
* Possible tokens are: d, dd, m, mm, yy, yyyy
*/
public $format = 'yyyy-mm-dd hh:ii';
/**
* @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 = '<div></div>';
/**
* @see Xeditable
* @see Init extension default
*/
public function init()
{
parent::init();
$this->registerAssets();
}
/**
* @see Xeditable
* @see Load extension with all settings
*/
public function settings()
{
}
/**
* @see Xeditable
* @see Init extension default
*/
public function registerAssets()
{
DateTimePickerAsset::register($this->view);
}
}