ownego / polaris-vue

Shopify Polaris design system for Vue JS. Shopify’s design system to help us build the great apps for all of our merchants.
https://ownego.github.io/polaris-vue/
MIT License
142 stars 29 forks source link

disableSpecificDates option of DatePicker is not working #206

Closed alessmar closed 8 months ago

alessmar commented 1 year ago

I use the DatePicker in the template section, like:

<DatePicker
  :disableDatesBefore="disableDateBefore()"
  :disableSpecificDates="disabledDates"
  :month="pickerView.month"
  :year="pickerView.year"
  weekStartsOn="1"
  @change="handleDateChange"
  @month-change="handleMonthChange"
  v-if="displayDatePicker"
/>

and I setup the disabledDates array to exclude saturdays and sundays:

<script setup>
import dayjs from 'dayjs'
const disabledDates = [ ...Array(60).keys() ].map(i => dayjs().add(i, 'day')).filter(i => [0,6].includes(i.day())).map(i => i.toDate());
....
</script>

unfortunately the rendered date picker still displays saturdays and sundays as active and clickable.

Below the dependency with the lib:

"@ownego/polaris-vue": {
    "version": "1.3.9",
    "resolved": "https://registry.npmjs.org/@ownego/polaris-vue/-/polaris-vue-1.3.9.tgz",
    "integrity": "sha512-vqRU1NI24L586ChjCmLsWLREtu0hz11lZCC7nTvVl4DqdyhOFIyxgUcRigR/BHICAlS8Z0YFVfagrlWJ2rJx+w==",
    "requires": {
      "@shopify/polaris-icons": "^6.5.0",
      "vite-svg-loader": "^3.1.2",
      "vue": "^3.2.31",
      "vue-router": "^4.1.6"
    }
  }
juzser commented 8 months ago

Close due to v2 has been released.