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

Method isSelected(date) missing #3

Closed
federicoibba opened this issue Jul 31, 2017 · 6 comments
Closed

Method isSelected(date) missing #3

federicoibba opened this issue Jul 31, 2017 · 6 comments

Comments

@federicoibba
Copy link

This calendar is good and provides all the functions someone can need, good job!
One enhancement that I could suggest is to implement a method to check if a certain date is already selected.

@GramThanos
Copy link
Owner

Good idea! I can add it.

And maybe some more isXY(..) methods would be nice, like:

calendar.isVisible(date); // Returns true if date is displayed
calendar.isInMonth(date); // Returns true if date is in active month

BTW, I personaly prefer isSelected over isSelect.

@federicoibba federicoibba changed the title Method isSelect(date) missing Method isSelected(date) missing Jul 31, 2017
@federicoibba
Copy link
Author

Yes, that was the idea. I prefer isSelected too (isSelect is a bad grammatical error, sorry).
I was searching for a good calendar to insert in a project and then I found yours. My need is to insert events into a calendar and doing something into it and a isSelected method would be great!

@GramThanos
Copy link
Owner

Implemented and are now live on developer version v1.4-beta for testing

calendar.isSelected(date); 8b47e12
calendar.isVisible(date); 733f819
calendar.isInMonth(date); 7221cf3

Also, to be honest, when I implemented the first release, I just added the select methods as a simple minimal feature. So, some more features may be needed, like calendar.getSelected(); (I will implement it).

@crist-y
Copy link

crist-y commented Aug 4, 2017

Hi mate, great job you're doing.
Is there a way to add a min date (ie: current date) and a maxdate (ie: current date = 1 year)?
Cheers!

@GramThanos
Copy link
Owner

Thanks. As this is a different issue, I opend one for it here #4.
Please express your thoughts over it there 😄

@GramThanos
Copy link
Owner

The method getSelected was implemented and is now live on developer version v1.4-beta for testing
calendar.getSelected(options); 3582a05

Examples :

myCalendar.getSelected();
// Returns [1483567200000, 1483394400000, 1483308000000, 1483221600000]

myCalendar.getSelected({sort:true});
// Returns [1483221600000, 1483308000000, 1483394400000, 1483567200000]

myCalendar.getSelected({sort:"desc",type:"DD-MM-YYYY"});
// Returns ["05-01-2017", "03-01-2017", "02-01-2017", "01-01-2017"]

myCalendar.getSelected({sort:"asc",type:"date"});
// Returns [Sun Jan 01 2017 00:00:00 GMT+0200 (GTB Standard Time), Mon Jan 02 2017 00:00:00 GMT+0200 (GTB Standard Time), Tue Jan 03 2017 00:00:00 GMT+0200 (GTB Standard Time), Thu Jan 05 2017 00:00:00 GMT+0200 (GTB Standard Time)]

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

No branches or pull requests

3 participants