Reputation: 28982
// This doesn't work
<input type='date' v-model='store.myDateObject'>
How can I bind a date input to a date object in my store?
Upvotes: 3
Views: 6050
Reputation: 28982
Assuming you want your dates as midnight UTC date objects, do this...
<input type='date'
:value='store.myDate.toJSON().substring(0,10)'
@input='store.myDate = new Date($event.target.value)'
>
Upvotes: 5