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

i need Priority also - it is possible to add ? #20

Open
ufi68 opened this issue Aug 7, 2017 · 0 comments
Open

i need Priority also - it is possible to add ? #20

ufi68 opened this issue Aug 7, 2017 · 0 comments

Comments

@ufi68
Copy link

ufi68 commented Aug 7, 2017

Hey, great calender - i would use it in my project but i need something like priority handling ?
It is possibe to add ?

for example something like

index.html:

priority: 'high' 
priority: 'medium' (this default if not set)  
priority: 'low'

css:

.c-event {
    background-color: darkgrey;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.c-event-high {
    background-color: grey;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.c-event-low {
    background-color: lightgrey;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

code: (sorry i'm not a great JavaScript developer ;):

for (var j = 0; j < settings.events.length; j++) {
                        var d = settings.events[j].datetime;
// default priority = 'medium'
						var p = settings.events[j].priority;
						if (typeof p === "undefined") {
							p = 'medium'; 	
							settings.events[j].priority = p;
						}
						
                        if (d.getDate() == day && d.getMonth() == dMonth && d.getFullYear() == dYear) {
							
							if (p == 'high' && !cDay.hasClass("c-event-high")) {
							   cDay.addClass('c-event-high').attr('data-event-day', d.getDate());
							}	
							
							if (p == 'medium' && !cDay.hasClass("c-event-high") && !cDay.hasClass("c-event")) {
							   cDay.addClass('c-event').attr('data-event-day', d.getDate());
							}	
							
							if (p == 'low' && !cDay.hasClass("c-event-high") && !cDay.hasClass("c-event") && !cDay.hasClass("c-event-low") ) {
								cDay.addClass('c-event-low').attr('data-event-day', d.getDate());
							}	
							
							
                            cDay.addClass('c-event').attr('data-event-day', d.getDate());
                            cDay.on('mouseover', mouseOverEvent).on('mouseleave', mouseLeaveEvent);
                        }
}

...

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