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

toDate function does not update selected date properly? #117

Open
ilovecoding294786 opened this issue Jun 20, 2019 · 0 comments
Open

toDate function does not update selected date properly? #117

ilovecoding294786 opened this issue Jun 20, 2019 · 0 comments

Comments

@ilovecoding294786
Copy link

this happens in vue-event-calendar
the watch property must be updated to the current date without 0s when toDate function hits

calendarParams () {
if (this.calendarParams.curEventsDate !== 'all') {
let events = this.events.filter(event => {
return isEqualDateStr(event.date, this.calendarParams.curEventsDate)
})
this.selectedDayEvents = {
// date: this.calendarParams.curEventsDate, // <-- instead of this line
date: this.calendarParams.curEventsDate.split('/').map((item) => {
return parseInt(item, 10)
}).join('/'), // <-- this fixed it
events
}
} else {
this.selectedDayEvents = {
date: 'all',
events: this.events
}
}
},

or if you are using moment you could just pass in moment(date).format('YYYY/M/D') within your toDate fn, incase you don't wanna change the inner component layer

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