#946·Pikaday

Dates in the date-picker are getting disabled after calling the gotoDate function on it

Author: Azan-MominCreated Jun 15, 2023Updated Jun 15, 2023

There is a date-picker element on a client's webpage. It is referred via self.$dateToInput variable. If I call the gotoDate function on that date-picker, then the date-picker shows up the correct month in the view. However, all the dates that were previously configured are getting disabled.

Can anybody please look into it and share the possible solution as this is a critical issue.

Sample code:

function setReturnCalendarView() {
	var self = this,	// Points to the parent component
	currentToDate = self.$dateToInput.data('pikaday').getMoment();	// Gets the date from the date-picker

	self.$dateToInput.data('pikaday').gotoDate(currentToDate.toDate());	// Shows up the intended month in the calendar view however, disables all the dates after this line is executed
}