Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moment object contains inconsistent timestamp #42

Open
mikeyfafa opened this issue Jan 10, 2021 · 0 comments
Open

Moment object contains inconsistent timestamp #42

mikeyfafa opened this issue Jan 10, 2021 · 0 comments

Comments

@mikeyfafa
Copy link

Here's my control.
<vue-monthly-picker selectedBackgroundColor="#66615b" v-bind:monthLabels="labels" clearOption placeHolder="MM/YYYY" dateFormat="MM/YYYY" v-model="user.MonthDate"> </vue-monthly-picker>

If I select April 2020 (04/2020) (for example)
this is the value I'm seeing when debugging.
this.user.MonthDate.toString(): "Wed Apr 01 2020 00:00:00 GMT+0100"
this.user.MonthDate.utc().toString(): "Tue Mar 31 2020 23:00:00 GMT+0000"
this.user.MonthDate.utc().month(): 2
this.user.MonthDate.month(): 2

But it I select Mar 2020 (03/2020)
I see this value
this.user.MonthDate.toString(): "Tue Mar 31 2020 23:00:00 GMT+0000"
this.user.MonthDate.utc().toString(): "Tue Mar 31 2020 23:00:00 GMT+0000"
this.user.MonthDate.utc().month(): 2
this.user.MonthDate.month(): 2

Because of this, when I use April, May etc the month() function is returning me the wrong value i.e. 2 for April instead of 3. If I select Mar then it's also 2 so I can't tell what the real month is. Is there a workaround or can this be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant