Skip to content

Filter date

This component provides a date-filtering functionality, allowing users to select a single date while ensuring compatibility with defined minimum and maximum constraints. It handles state updates automatically.

WARNING

This component can only be used within a Filter.

Props

icon?: FluxIconName
The icon of the filter.

label: string
The label of the filter.

max?: DateTime
The maximum date that can be selected.

min?: DateTime
The minimum date that can be selected.

name: string
The name of the filter within the filter state.

Snippet

vue
<template>
    <FluxPane style="width: max-content">
        <FluxFilter v-model="filterState">
            <FluxFilterDate
                icon="calendar"
                label="Date"
                name="option"/>
        </FluxFilter>
    </FluxPane>
</template>

<script
    lang="ts"
    setup>
    import { FluxFilter, FluxFilterDate, FluxPane } from '@flux-ui/components';
    import type { FluxFilterState } from '@flux-ui/types';
    import { DateTime } from 'luxon';
    import { ref } from 'vue';

    const filterState = ref<FluxFilterState>({
        option: DateTime.now(),

        get resettable(): string[] {
            return [];
        },

        reset(): void {
        }
    });
</script>

Used components