| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function render() |
||
| 33 | { |
||
| 34 | $this->options['locale'] = config('app.locale'); |
||
| 35 | |||
| 36 | $startOptions = json_encode($this->options); |
||
| 37 | $endOptions = json_encode($this->options + ['useCurrent' => false]); |
||
| 38 | |||
| 39 | $this->script = <<<EOT |
||
| 40 | $('#{$this->id['start']}').datetimepicker($startOptions); |
||
| 41 | $('#{$this->id['end']}').datetimepicker($endOptions); |
||
| 42 | $("#{$this->id['start']}").on("dp.change", function (e) { |
||
| 43 | $('#{$this->id['end']}').data("DateTimePicker").minDate(e.date); |
||
| 44 | }); |
||
| 45 | $("#{$this->id['end']}").on("dp.change", function (e) { |
||
| 46 | $('#{$this->id['start']}').data("DateTimePicker").maxDate(e.date); |
||
| 47 | }); |
||
| 48 | EOT; |
||
| 49 | |||
| 50 | return parent::render(); |
||
| 51 | } |
||
| 52 | } |
||
| 53 |