mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Get datepicker working
This commit is contained in:
parent
5d1f98bf93
commit
6c5ec6a16c
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
namespace App\Livewire;
|
namespace App\Livewire;
|
||||||
|
|
||||||
use Illuminate\Support\Collection;
|
|
||||||
use Livewire\Attributes\Computed;
|
use Livewire\Attributes\Computed;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
|
@ -16,7 +15,6 @@ class CustomFieldSetDefaultValuesForModel extends Component
|
||||||
public $fieldset_id;
|
public $fieldset_id;
|
||||||
public $model_id;
|
public $model_id;
|
||||||
|
|
||||||
public Collection $cachedValues;
|
|
||||||
public array $selectedValues = [];
|
public array $selectedValues = [];
|
||||||
|
|
||||||
public function mount($model_id = null)
|
public function mount($model_id = null)
|
||||||
|
|
|
@ -30,7 +30,17 @@
|
||||||
|
|
||||||
<div class="input-group col-md-4" style="padding-left: 0px;">
|
<div class="input-group col-md-4" style="padding-left: 0px;">
|
||||||
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
|
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
|
||||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="default_values[{{ $field->id }}]" id="default-value{{ $field->id }}" value="{{ $field->defaultValue($model_id) }}">
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control"
|
||||||
|
placeholder="{{ trans('general.select_date') }}"
|
||||||
|
name="default_values[{{ $field->id }}]"
|
||||||
|
id="default-value{{ $field->id }}"
|
||||||
|
wire:model="selectedValues.{{ $field->db_column }}"
|
||||||
|
{{-- catch the onchange event and dispatch an InputEvent ourselves... --}}
|
||||||
|
{{-- https://laracasts.com/discuss/channels/livewire/livewire-and-bootstrap-datepicker?page=1&replyId=623122--}}
|
||||||
|
onchange="this.dispatchEvent(new InputEvent('input'))"
|
||||||
|
>
|
||||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue