[Prevent MazPicker to set default date to today if v-model has a value]
Is your feature request related to a problem? Please describe
I'm using MazPicker with :min-date="today" feature, and v-model="changeAuthorizedPersonData.transfer_to_sub_account.legal_expire_date" is binded to a date in the past
Describe the solution you'd like
Add an option to pass to the package that upon picker open don't set the date to today if the v-model is binded to a date in the past, let the user select by himself
Keep the dates dimmed but don't pre-set the value to today
Current version 3.50.1
<MazPicker v-model="changeAuthorizedPersonData.transfer_to_sub_account.legal_expire_date" :state="v$.transfer_to_sub_account.legal_expire_date.$errors.length ? false : null" id="legal_expire_date" name="legal_expire_date" :min-date="today" :max-date="tenYearsFromToday" :locale="locale" :no-header="true" :auto-close="true" class="col-12" :inputDateStyle="{dateStyle: 'medium'}" :input-date-transformer="({ value }) => dateFormatter(value, locale)!" :placeholder="t('global.IDENTITY_EXPIRE_DATE_PLACEHOLDER')" @update:model-value="changeAuthorizedPersonData.transfer_to_sub_account.legal_expire_date = dayjs(changeAuthorizedPersonData.transfer_to_sub_account.legal_expire_date).format('YYYY/MM/DD')" />
@LouisMazel plz support with any enhancement expectations date
@LouisMazel any updates?
Hi @hadelnasr
I'm currently working on the v4. This is will fixed in this version.
I hope release this new major version next week
@LouisMazel thanks for your feedback, really appreciate it
@LouisMazel any updates so far?
@LouisMazel any updates??
@LouisMazel any estimations plz?
@LouisMazel @pboos @developerdino @dnyer11
guys, any updates for the fix update??
Hi @hadelnasr,
I will release v4 of the library today or tomorrow (I hope), with a new property min-max-auto to control this behavior.
I have to test the new version again.
You can already test it with the beta version (v4.0.0-beta.31)
You're using Vue
npm install maz-ui@beta @maz-ui/themes@beta
You must install the MazUi plugin. You can check the documentation here
import { MazUi } from 'maz-ui/plugins/maz-ui'
import { mazUi } from '@maz-ui/themes/presets'
import { en } from '@maz-ui/translations'
import { createApp } from 'vue'
import 'maz-ui/styles'
import App from './App.vue'
const app = createApp(App)
app.use(MazUi, {
theme: {
preset: mazUi,
},
translations: {
locale: 'en',
fallbackLocale: 'fr',
messages: {
en,
},
},
})
app.mount('#app')
You're using Nuxt
npm install maz-ui@beta @maz-ui/nuxt@beta
Add the module to your nuxt.config.ts:
export default defineNuxtConfig({
modules: ['@maz-ui/nuxt']
})
Breaking changes
MazPicker (MazDatePicker)
The component has been renamed: MazPicker --> MazDatePicker
Some properties have changed too :
no-header-->hide-headerinput-date-style-->input-date-format
Theming
The color management has completely changed. Check out the documentation here
New integration
<script lang="ts" setup>
import { ref } from 'vue'
import MazDatePicker from 'maz-ui/components/MazDatePicker'
const date = ref('2023-01-01')
</script>
<template>
<MazDatePicker
v-model="date"
hide-header
:input-date-format="{dateStyle: 'medium'}"
:min-date="today"
:max-date="tenYearsFromToday"
:min-max-auto="false"
... etc
/>
<template>
Ask me here if you have any questions
@LouisMazel thanks so much for your support, i will give it a try and get back to you ASAP
I released the v4 2 days ago, so the documentation has been updated too 😊
If you have any prob, ask me: https://maz-ui.com Date Picker : https://maz-ui.com/components/maz-input-phone-number
If needed, v3 documentation is here: https://v3.maz-ui.com
If you're using IA, an MCP is available to help you: https://maz-ui.com/guide/mcp
I closed the issue, it's now fixed