radix-vue / shadcn-vue

Vue port of shadcn-ui
https://www.shadcn-vue.com/
MIT License
3.51k stars 203 forks source link

DatePicker not getting min-value #604

Closed IsaqjonovII closed 2 weeks ago

IsaqjonovII commented 2 weeks ago

Hello, I wanted to give a calendar min value like this

<Calendar v-model="selectedDate" initial-focus :min-value="nextWeek" />

But it showing type error and not working. Type 'Date' is not assignable to type 'DateValue | undefined'.ts-plugin(2322)

Here is my code:

const sevenDaysFromNow = computed(() => {
  const date = new Date();
  return new Date(date.setDate(date.getDate() + 7));
});

How can I fix it?

sadeghbarati commented 2 weeks ago

Are you using @internationalized/date DatePicker or v-calendar DatePicker?

Can you share a demo or reproduction in Stackblitz or Codesandbox

Closing for now will reopen after repro