Created
October 12, 2015 12:51
-
-
Save Swimburger/0d7da8deec406c10227d to your computer and use it in GitHub Desktop.
pure js renderer for CLNDR https://github.com/kylestetz/CLNDR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#calendar').clndr({ | |
render: function (data) { | |
return renderCalendar(data); | |
} | |
}); | |
} | |
function renderCalendar(data){ | |
var html='', | |
i= 0, | |
day; | |
html += '<div class="clndr-controls"><div class="clndr-previous-button">‹</div><div class="month">'+data.month+'</div><div class="clndr-next-button">›</div></div>'; | |
html += '<div class="clndr-grid"><div class="days-of-the-week">'; | |
for(i;i<data.daysOfTheWeek.length;i++){ | |
day = data.daysOfTheWeek[i]; | |
html+= '<div class="header-day">'+day+'</div>'; | |
} | |
for(i=0;i<data.days.length;i++){ | |
day = data.days[i]; | |
html+= '<div class="'+day.classes+'">'+ day.day +'</div>'; | |
} | |
html+='</div></div></div>'; | |
return html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment