#113633
admin
Keymaster

Hi,

For Smart.DateInput, the cleanest pattern is to keep the application state as the single source of truth and treat the component value as a controlled input. The component should handle user interaction, while Redux/Vuex/Pinia (or another store) owns the selected date value.

A typical flow is:

1. Store the date value in your global state.
2. Bind Smart.DateInput’s value to that state.
3. Listen for the component’s change event.
4. Dispatch an action/update the store when the user changes the date.
5. Let the store update flow back into the component.

Example with Vue-style state management:

<smart-date-input
    :value="selectedDate"
    @change="onDateChange">
</smart-date-input>

computed: {
    selectedDate() {
        return this.$store.state.filters.date;
    }
},
methods: {
    onDateChange(event) {
        this.$store.commit('setDate', event.detail.value);
    }
}

Regards,
Markov