1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace JeroenNoten\LaravelAdminLte\Components; |
4
|
|
|
|
5
|
|
|
class DateRange extends InputGroupComponent |
6
|
|
|
{ |
7
|
|
|
/** |
8
|
|
|
* The DateRangePicker plugin configuration parameters. Array with |
9
|
|
|
* key => value pairs, where the key should be an existing configuration |
10
|
|
|
* property of the plugin. |
11
|
|
|
* |
12
|
|
|
* @var array |
13
|
|
|
*/ |
14
|
|
|
public $config; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Enables a default set of ranges option. The string value, if any, will |
18
|
|
|
* be used as the initial date range. The available values are: 'Today', |
19
|
|
|
* 'Yesterday', 'Last 7 Days', 'Last 30 Days', 'This Month' or 'Last Month'. |
20
|
|
|
* |
21
|
|
|
* @var bool|string |
22
|
|
|
*/ |
23
|
|
|
public $enableDefaultRanges; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Create a new component instance. |
27
|
|
|
* Note this component requires the 'DateRangePicker' and 'Moment' plugins. |
28
|
|
|
* |
29
|
|
|
* @return void |
30
|
|
|
*/ |
31
|
1 |
|
public function __construct( |
32
|
|
|
$name, $label = null, $size = null, $labelClass = null, |
33
|
|
|
$topClass = null, $inputGroupClass = null, $disableFeedback = null, |
34
|
|
|
$config = [], $enableDefaultRanges = null |
35
|
|
|
) { |
36
|
1 |
|
parent::__construct( |
37
|
1 |
|
$name, $label, $size, $labelClass, $topClass, |
38
|
|
|
$inputGroupClass, $disableFeedback |
39
|
|
|
); |
40
|
|
|
|
41
|
1 |
|
$this->config = is_array($config) ? $config : []; |
42
|
1 |
|
$this->enableDefaultRanges = $enableDefaultRanges; |
43
|
1 |
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Get the view / contents that represent the component. |
47
|
|
|
* |
48
|
|
|
* @return \Illuminate\View\View|string |
49
|
|
|
*/ |
50
|
1 |
|
public function render() |
51
|
|
|
{ |
52
|
1 |
|
return view('adminlte::components.date-range'); |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|