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

toggle multi dates selected on load / initialize #95

Open
SyedOsama8 opened this issue Sep 23, 2018 · 2 comments
Open

toggle multi dates selected on load / initialize #95

SyedOsama8 opened this issue Sep 23, 2018 · 2 comments

Comments

@SyedOsama8
Copy link

SyedOsama8 commented Sep 23, 2018

Hello ! I am able to select multiple dates by click using "toggle" function but I don't know, how to show selected dates. For example: At the time of Initialize calendar, I want to select dates ["2018-09-01", "2018-09-06", "2018-09-12"]. Also open toggle option so user can select more random dates.
image

How can I disable all previous/past dates ?

@pearrrrrrr
Copy link

Hi, anyone know how to solve this ?

@greenars-sftwr
Copy link

greenars-sftwr commented Apr 14, 2021

I found a solution... A function JS that receive an string dates separated by Comma (,). This simulate a click in every dates of your calendar and active them.

function click_on_dates(dates){
	dates_array=dates.split(",");
	calendar=".calendario_no_disponibles"; // Your calendar selector
	for (var i = 0; i <= dates_array.length; i++) {
		$(calendar + " [data-date='"+dates_array[i]+"']").click();
	}
}

To use: click_on_dates("2021-04-15,2021-04-16");

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

3 participants