format = $format; return $this; } protected function prepareToSave($value) { if ($value === '') { $value = null; } return $value; } public function render() { $this->options['format'] = $this->format; $this->options['locale'] = config('app.locale'); $this->options['allowInputToggle'] = true; $this->script = "$('{$this->getElementClassSelector()}').parent().datetimepicker(".json_encode($this->options).');'; $this->prepend('') ->defaultAttribute('style', 'width: 200px'); return parent::render(); } public static function collectAssets() { Admin::collectComponentAssets('moment'); Admin::collectComponentAssets('bootstrap-datetimepicker'); } }