[Vuejs]-How To Edit Date and Time Picker Vuejs Vuetify From Firebase Using Latest Version

2πŸ‘

βœ…

In Vuetify document, the value which is passed to v-date-picker need to be an array or string. You can convert:

 methods: {
       onSaveChanges () {
         const newDate = new Date(this.meetup.date)
         const newDay = new Date(this.editableDate).getUTCDate()
         const newMonth = new Date(this.editableDate).getUTCMonth()
         const newYear = new Date(this.editableDate).getUTCFullYear()
         newDate.setUTCDate(newDay)
         newDate.setUTCMonth(newMonth)
         newDate.setUTCFullYear(newYear)
         this.$store.dispatch('updateMeetupData', {
           id: this.meetup.id,
           date: newDate.toISOString().substr(0, 10)
         })
       }
    },
    created () {
      this.editableDate = new Date(this.meetup.date).toISOString().substr(0, 10)
    }

Leave a comment