[SOLVED] Invalid prop: type check failed for prop "max". Expected String, Date, got Date
See original GitHub issueDescribe the bug
I follow steps on Form DatePicker docs for disabling days, but on :max and :min return an error on console:
[Vue warn]: Invalid prop: type check failed for prop “max”. Expected String, Date, got Date
My code
<template>
<b-form-row class="form-wrapper">
<b-form-datepicker
:inline="true"
:min="minDate"
:max="maxDate"
id="date-from"
v-model="form.from"
placeholder="Data"
locale="pt-BR"
:date-format-options="{
year: 'numeric',
month: '2-digit',
day: '2-digit',
}"
/>
<b-form-datepicker
:inline="true"
id="date-to"
:min="minDate"
:max="maxDate"
v-model="form.to"
placeholder="Data"
locale="pt-BR"
:date-format-options="{
year: 'numeric',
month: '2-digit',
day: '2-digit',
}"
/>
</b-form-row>
</template>
<script>
export default {
data() {
const now = new Date()
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate())
const minDate = new Date(today)
const maxDate = new Date(today)
maxDate.setFullYear(maxDate.getFullYear() + 3)
return {
minDate,
maxDate,
}
},
}
</script>
- BootstrapVue: 2.17.3
- Bootstrap: 4.5.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
[Vue warn]: Invalid prop: type check failed for prop "maxDate ...
Hello, I am using Nuxt-Buefy (latest version) with the latest version of Nuxt (2.4.5). When I use the datepicker component and put a...
Read more >type check failed for prop. Expected Date, got Number with ...
This returns the following two errors: Invalid prop: type check failed for prop "firstDate". Expected Date, got Number with value -2019. and.
Read more >[vue warn]: invalid prop: type check failed for prop - You.com
When the page is loaded server-side, these warnings appear in the server console: "[Vue warn]: Invalid prop: type check failed for prop "maxDate"....
Read more >[Solved]-[Vue warn]: Invalid prop: type check failed for prop ...
Coding example for the question [Vue warn]: Invalid prop: type check failed for prop "productCartData". Expected Object, got String with value "[object ...
Read more >type check failed for prop "value". Expected Date, got String ...
Vue DatePicker : Invalid prop: type check failed for prop "value". Expected Date, got String ... Hi All,. I am trying to use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The docs are wrong. Change
:max="new Date()"
to:max="new Date().toISOString()"
. They don’t show converting to iso string in docs example but it will throw error if you don’t.@travis5491811 Transform date in
toISOString()
solved my problem.