@@ 11-37 (lines=27) @@ | ||
8 | use Webfactor\Laravel\Backpack\FluentSyntax\Traits\Prefixable; |
|
9 | use Webfactor\Laravel\Backpack\FluentSyntax\Traits\Suffixable; |
|
10 | ||
11 | class DatePickerField extends CrudFieldAbstract |
|
12 | { |
|
13 | use Hintable, Defaultable; |
|
14 | ||
15 | protected $type = 'date_picker'; |
|
16 | ||
17 | public function todayButton(bool $button = true) |
|
18 | { |
|
19 | $this->options['date_picker_options']['todayBtn'] = $button; |
|
20 | ||
21 | return $this; |
|
22 | } |
|
23 | ||
24 | public function format(string $format) |
|
25 | { |
|
26 | $this->options['date_picker_options']['format'] = $format; |
|
27 | ||
28 | return $this; |
|
29 | } |
|
30 | ||
31 | public function language(string $language) |
|
32 | { |
|
33 | $this->options['date_picker_options']['language'] = $language; |
|
34 | ||
35 | return $this; |
|
36 | } |
|
37 | } |
|
38 |
@@ 11-37 (lines=27) @@ | ||
8 | use Webfactor\Laravel\Backpack\FluentSyntax\Traits\Prefixable; |
|
9 | use Webfactor\Laravel\Backpack\FluentSyntax\Traits\Suffixable; |
|
10 | ||
11 | class DateTimePickerField extends CrudFieldAbstract |
|
12 | { |
|
13 | use Hintable, Defaultable; |
|
14 | ||
15 | protected $type = 'datetime_picker'; |
|
16 | ||
17 | public function nullable(bool $nullable = true) |
|
18 | { |
|
19 | $this->options['allows_null'] = $nullable; |
|
20 | ||
21 | return $this; |
|
22 | } |
|
23 | ||
24 | public function format(string $format) |
|
25 | { |
|
26 | $this->options['datetime_picker_options']['format'] = $format; |
|
27 | ||
28 | return $this; |
|
29 | } |
|
30 | ||
31 | public function language(string $language) |
|
32 | { |
|
33 | $this->options['datetime_picker_options']['language'] = $language; |
|
34 | ||
35 | return $this; |
|
36 | } |
|
37 | } |
|
38 |