Skip to content

Commit

Permalink
fixed date group configuration issue..
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Feb 27, 2021
1 parent 0bb114d commit 096d9f2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
16 changes: 14 additions & 2 deletions resources/assets/js/components/AkauntingDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)"
Expand Down
9 changes: 5 additions & 4 deletions resources/views/partials/form/date_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,21 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}"
: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
}"

Expand Down
8 changes: 4 additions & 4 deletions resources/views/partials/form/date_time_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}"
:model="{{ $attributes['model'] }}"
@endif

:config="{
:date-config="{
allowInput: true,
@if (!empty($attributes['show-date-format']))
altInput: true,
Expand All @@ -34,13 +34,13 @@ class="{{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}"
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
}"

Expand Down

0 comments on commit 096d9f2

Please sign in to comment.