maz-ui icon indicating copy to clipboard operation
maz-ui copied to clipboard

[Prevent MazPicker to set default date to today if v-model has a value]

Open hadelnasr opened this issue 6 months ago • 1 comments

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')" />

hadelnasr avatar Jun 22 '25 14:06 hadelnasr

@LouisMazel plz support with any enhancement expectations date

hadelnasr avatar Jun 24 '25 11:06 hadelnasr

@LouisMazel any updates?

hadelnasr avatar Jul 01 '25 08:07 hadelnasr

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 avatar Jul 01 '25 22:07 LouisMazel

@LouisMazel thanks for your feedback, really appreciate it

hadelnasr avatar Jul 02 '25 06:07 hadelnasr

@LouisMazel any updates so far?

hadelnasr avatar Jul 09 '25 10:07 hadelnasr

@LouisMazel any updates??

hadelnasr avatar Jul 18 '25 21:07 hadelnasr

@LouisMazel any estimations plz?

hadelnasr avatar Jul 23 '25 14:07 hadelnasr

@LouisMazel @pboos @developerdino @dnyer11

guys, any updates for the fix update??

hadelnasr avatar Aug 07 '25 12:08 hadelnasr

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

Documentation

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

Migration Guide

MazPicker (MazDatePicker)

The component has been renamed: MazPicker --> MazDatePicker

Some properties have changed too :

  • no-header --> hide-header
  • input-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 avatar Aug 07 '25 14:08 LouisMazel

@LouisMazel thanks so much for your support, i will give it a try and get back to you ASAP

hadelnasr avatar Aug 10 '25 06:08 hadelnasr

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

LouisMazel avatar Aug 10 '25 07:08 LouisMazel

I closed the issue, it's now fixed

LouisMazel avatar Aug 11 '25 07:08 LouisMazel