jackducasse / caleandar Goto Github PK
View Code? Open in Web Editor NEWA lightweight, library independent JavaScript calendar
License: MIT License
A lightweight, library independent JavaScript calendar
License: MIT License
I'm not too familiar with js & I was wondering if you could help me remove the "link" function from events that show on the calendar. I just want plain text to display on the calendar itself, not link to anywhere. Long story short, I'm wondering how to re-write this section of the js file so that it isn't a link, but plain text:
var number = DayNumber(i+1);
// Check Date against Event Dates
for(var n = 0; n < calendar.Model.length; n++){
var evDate = calendar.Model[n].Date;
var toDate = new Date(calendar.Selected.Year, calendar.Selected.Month, (i+1));
if(evDate.getTime() == toDate.getTime()){
number.className += " eventday";
var title = document.createElement('span');
title.className += "cld-title";
if(typeof calendar.Model[n].Link == 'function' || calendar.Options.EventClick){
var a = document.createElement('a');
a.setAttribute('href', '#');
a.innerHTML += calendar.Model[n].Title;
if(calendar.Options.EventClick){
var z = calendar.Model[n].Link;
if(typeof calendar.Model[n].Link != 'string'){
a.addEventListener('click', calendar.Options.EventClick.bind.apply(calendar.Options.EventClick, [null].concat(z)) );
if(calendar.Options.EventTargetWholeDay){
day.className += " clickable";
day.addEventListener('click', calendar.Options.EventClick.bind.apply(calendar.Options.EventClick, [null].concat(z)) );
}
}else{
a.addEventListener('click', calendar.Options.EventClick.bind(null, z) );
if(calendar.Options.EventTargetWholeDay){
day.className += " clickable";
day.addEventListener('click', calendar.Options.EventClick.bind(null, z) );
}
}
}else{
a.addEventListener('click', calendar.Model[n].Link);
if(calendar.Options.EventTargetWholeDay){
day.className += " clickable";
day.addEventListener('click', calendar.Model[n].Link);
}
}
title.appendChild(a);
}else{
title.innerHTML += '' + calendar.Model[n].Title + '';
}
number.appendChild(title);
}
}
day.appendChild(number);
// If Today..
if((i+1) == calendar.Today.getDate() && calendar.Selected.Month == calendar.Today.Month && calendar.Selected.Year == calendar.Today.Year){
day.className += " today";
}
days.appendChild(day);
}
Thank you in advance!
can you tell me how can i get the date which is clicked by user?
My JS is very very rusty and I'm trying to get 'Title' from my events array to appear in a div below the caleander on my page for mobile users. Not sure how to accomplish this or if I have to use a different theme.
Hi!
Is it possibile to localize the date strings?
When I enter an event date of 6 it displays in July.
Logically 6 should be June.
Looks like it is counting starting at 0 as a entry of 0 displays as January.
The day and year number display correctly.
Love it other than that.
Thanks
Tim
var events = [
{'Date': new Date(2016, 6, 1), 'Title': 'Doctor appointment at 3:25pm.'},
{'Date': new Date(2016, 6, 7), 'Title': 'New Garfield movie comes out!', 'Link': 'https://garfield.com'},
{'Date': new Date(2016, 6, 11), 'Title': '25 year anniversary', 'Link': 'https://www.google.com.au/#q=anniversary+gifts'},
];
Fine library!
Is it possible to get the weekday of a clicked cld-day?
Mon, Tues etc.
TIA
Hi,
Nice plugin, but please is there a way i can set the future events on the calendar?
I noticed when i pass them only events on the present month get attached to the calendar. when i navigate to the future event date they are not present on the calendar,thanks.
Hi,
can i start the Calendar with firstday = Monday?
A second call to caleandar(element,events); in a vain attempt to reload the calendar produces no error but does nothing. This is a use-case where I can't reload the parent container.
Hi, dates with times greater than 00-00 are not displayed.
It seems that if I have 2 events in the same day, the second one override the first one...
It is possible to change the background of 'cld-number eventday'. But may I know how I can change the background of cld-day currMonth event day ?
I want to use form to search specific year and month
Did anyone thought about it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.