fixed date group configuration issue..

This commit is contained in:
Cüneyt Şentürk 2021-02-27 16:54:39 +03:00
parent 0bb114de71
commit 096d9f29be
3 changed files with 23 additions and 10 deletions

View File

@ -14,7 +14,7 @@
<flat-picker slot-scope="{focus, blur}"
@on-open="focus"
@on-close="blur"
:config="config"
:config="dateConfig"
class="form-control datepicker"
v-model="real_model"
@input="change"
@ -67,7 +67,19 @@ export default {
default: null,
description: "Input model defalut"
},
config: null,
dateConfig: {
type: Object,
default: function () {
return {
allowInput: true,
altFormat: "d M Y",
altInput: true,
dateFormat: "Y-m-d",
wrap: true,
};
},
description: "FlatPckr date configuration"
},
icon: {
type: String,
description: "Prepend icon (left)"

View File

@ -24,20 +24,21 @@
:model="{{ $attributes['model'] }}"
@endif
:config="{
:date-config="{
wrap: true, // set wrap to true only when using 'input-group'
allowInput: true,
@if (!empty($attributes['show-date-format']))
altInput: true,
altFormat: '{{ $attributes['show-date-format'] }}',
@endif
@if (!empty($attributes['date-format']))
dateFormat: '{{ $attributes['date-format'] }}'
dateFormat: '{{ $attributes['date-format'] }}',
@endif
@if (!empty($attributes['min-date']))
minDate: {{ $attributes['min-date'] }}
minDate: {{ $attributes['min-date'] }},
@endif
@if (!empty($attributes['max-date']))
maxDate: {{ $attributes['max-date'] }}
maxDate: {{ $attributes['max-date'] }},
@endif
}"

View File

@ -22,7 +22,7 @@
:model="{{ $attributes['model'] }}"
@endif
:config="{
:date-config="{
allowInput: true,
@if (!empty($attributes['show-date-format']))
altInput: true,
@ -34,13 +34,13 @@
wrap: true,
enableTime: true,
@if (!empty($attributes['seconds']))
enableSeconds: true
enableSeconds: true,
@endif
@if (!empty($attributes['min-date']))
minDate: {{ $attributes['min-date'] }}
minDate: {{ $attributes['min-date'] }},
@endif
@if (!empty($attributes['max-date']))
maxDate: {{ $attributes['max-date'] }}
maxDate: {{ $attributes['max-date'] }},
@endif
}"