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

Disable dates in year view #259

Open
reholmes27 opened this issue Sep 25, 2023 · 0 comments
Open

Disable dates in year view #259

reholmes27 opened this issue Sep 25, 2023 · 0 comments

Comments

@reholmes27
Copy link

I can implement a setup where I select a start date and then disable prior dates in an end date input, however, if I try and do it with just the year and month setup, it doesn't disable previous months. Example:

let startDate = $('.sStartDate').fdatepicker({
startView: 'year',
minView: 'year',
format: "mm/yyyy",
closeButton: true,
closeIcon: '',
})
.on( 'changeDate', function(ev) {
selectedDate = new Date(ev.date);

    $('.sEndDate').fdatepicker({ 
	startDate: selectedDate,
	startView: 'year',
	minView: 'year',
	format: "mm/yyyy",
	onRender: function (date) {
		return date.valueOf() < selectedDate.valueOf() ? 'disabled' : '';
	}
});

})
.data('datepicker');

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