How to fix date issue with momentjs and vuejs-datepicker

324 Views Asked by At

I am using vuejs-datepicker and I set datepicker (calendar) to today date by default like this:

<datepicker v-model="theDate" format="yyyy-MM-dd"></datepicker>
<!--shows yesterday date in calendar instead of today. "format" needed to get right format.-->

...
data() {
    return {
        myDate: null
    }
},
...
created() {
    this.myDate = this.$moment().format("YYYY-MM-DD")
    console.log(this.myDate) //gives me today date in right format but does not show the same
}
...

This must be very basic and simple thing. But I don't really get why it is showing yesterday date and how to fix it.

Update: this describes my issue: https://github.com/charliekassel/vuejs-datepicker/issues/23

1

There are 1 best solutions below

0
Cutis On