Skip to content

Commit

Permalink
feat: year slider functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
FrantisekMichalSebestyen committed Aug 23, 2023
1 parent bb4f08c commit 0684893
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions resources/views/frontend/catalog-new/index-new.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,12 @@ class="tw-mb-3">
{{ trans('item.filter.clear') }}
</x-filter.reset_button>
</div>
<filter-new-year-slider :default-from="Number(query.yearRange?.from)"
:default-to="Number(query.yearRange?.to)" :min="{{ $yearLimits['min'] ?? 0 }}"
:max="{{ $yearLimits['max'] ?? now()->year }}"
@change="handleYearRangeChange">
<filter-new-year-slider
v-bind:default-from="Number(query.yearRange?.from)"
v-bind:default-to="Number(query.yearRange?.to)"
v-bind:min="Number(aggregations.date_earliest) - 5"
v-bind:max="Math.min(Number(aggregations.date_latest) + 5, new Date().getFullYear())"
v-on:change="handleYearRangeChange">
</filter-new-year-slider>
</div>
</div>
Expand Down Expand Up @@ -389,9 +391,11 @@ class="tw-ml-2"
@endslot
@slot('body')
<filter-new-year-slider class="tw-px-4"
:default-from="Number(query.yearRange?.from)" :default-to="Number(query.yearRange?.to)"
:min="{{ $yearLimits['min'] ?? 0 }}" :max="{{ $yearLimits['max'] ?? now()->year }}"
@change="handleYearRangeChange">
v-bind:default-from="Number(query.yearRange?.from)"
v-bind:default-to="Number(query.yearRange?.to)"
v-bind:min="Number(aggregations.date_earliest) - 5"
v-bind:max="Math.min(Number(aggregations.date_latest) + 5, new Date().getFullYear())"
v-on:change="handleYearRangeChange">
</filter-new-year-slider>
<div v-if="query.yearRange"
class="tw-flex tw-justify-center">
Expand Down

0 comments on commit 0684893

Please sign in to comment.