M
M
Marcel Sultanov2021-03-07 03:14:19
Vue.js
Marcel Sultanov, 2021-03-07 03:14:19

Date setting bug with manual input?

There is a date and time input, where through watch I set the current time, but when I start manually entering the date, moment js updates the date, but there is a glitch that it returns the current time again, who can tell what kind of glitch is so incomprehensible?
template

<b-form-input
                                id="receive_datetime"
                                :type="`datetime-local`"
                                v-model="editedItem.receive_datetime"
                            ></b-form-input>


watch
"editedItem.receive_datetime": function(value) {
                this.editedItem.receive_datetime = value ?
                    this.$moment(value).format('YYYY-MM-DDTHH:mm') :
                    this.$moment.utc().local().format('YYYY-MM-DDTHH:mm')
            },

60441a9ac30b7957332640.gif

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question