2 lines
22 KiB
JavaScript
2 lines
22 KiB
JavaScript
|
/*! clndr.min.js v1.4.7 2016-11-26 */
|
||
|
!function(a){"function"==typeof define&&define.amd?define(["jquery","moment"],a):"object"==typeof exports?a(require("jquery"),require("moment")):a(jQuery,moment)}(function(a,b){function c(c,e){var g,h,i;this.element=c,this.options=a.extend(!0,{},f,e),this.options.moment&&(b=this.options.moment),this.constraints={next:!0,today:!0,previous:!0,nextYear:!0,previousYear:!0},this.options.events.length&&(this.options.multiDayEvents?this.options.events=this.addMultiDayMomentObjectsToEvents(this.options.events):this.options.events=this.addMomentObjectToEvents(this.options.events)),this.options.lengthOfTime.months||this.options.lengthOfTime.days?this.options.lengthOfTime.months?(this.options.lengthOfTime.days=null,this.options.lengthOfTime.startDate?this.intervalStart=b(this.options.lengthOfTime.startDate).startOf("month"):this.options.startWithMonth?this.intervalStart=b(this.options.startWithMonth).startOf("month"):this.intervalStart=b().startOf("month"),this.intervalEnd=b(this.intervalStart).add(this.options.lengthOfTime.months,"months").subtract(1,"days"),this.month=this.intervalStart.clone()):this.options.lengthOfTime.days&&(this.options.lengthOfTime.startDate?this.intervalStart=b(this.options.lengthOfTime.startDate).startOf("day"):this.intervalStart=b().weekday(0).startOf("day"),this.intervalEnd=b(this.intervalStart).add(this.options.lengthOfTime.days-1,"days").endOf("day"),this.month=this.intervalStart.clone()):(this.month=b().startOf("month"),this.intervalStart=b(this.month),this.intervalEnd=b(this.month).endOf("month")),this.options.startWithMonth&&(this.month=b(this.options.startWithMonth).startOf("month"),this.intervalStart=b(this.month),this.intervalEnd=this.options.lengthOfTime.days?b(this.month).add(this.options.lengthOfTime.days-1,"days").endOf("day"):b(this.month).endOf("month")),this.options.constraints&&(this.options.constraints.startDate&&(i=b(this.options.constraints.startDate),this.options.lengthOfTime.days?(this.intervalStart.isBefore(i,"week")&&(this.intervalStart=i.startOf("week")),g=this.intervalStart.diff(this.intervalEnd,"days"),(g<this.options.lengthOfTime.days||this.intervalEnd.isBefore(this.intervalStart))&&(this.intervalEnd=b(this.intervalStart).add(this.options.lengthOfTime.days-1,"days").endOf("day"),this.month=this.intervalStart.clone())):(this.intervalStart.isBefore(i,"month")&&(this.intervalStart.set("month",i.month()).set("year",i.year()),this.month.set("month",i.month()).set("year",i.year())),this.intervalEnd.isBefore(i,"month")&&this.intervalEnd.set("month",i.month()).set("year",i.year()))),this.options.constraints.endDate&&(h=b(this.options.constraints.endDate),this.options.lengthOfTime.days?this.intervalStart.isAfter(h,"week")&&(this.intervalStart=b(h).endOf("week").subtract(this.options.lengthOfTime.days-1,"days").startOf("day"),this.intervalEnd=b(h).endOf("week"),this.month=this.intervalStart.clone()):(this.intervalEnd.isAfter(h,"month")&&(this.intervalEnd.set("month",h.month()).set("year",h.year()),this.month.set("month",h.month()).set("year",h.year())),this.intervalStart.isAfter(h,"month")&&this.intervalStart.set("month",h.month()).set("year",h.year())))),this._defaults=f,this._name=d,this.init()}var d="clndr",e="<div class='clndr-controls'><div class='clndr-control-button'><span class='clndr-previous-button'>previous</span></div><div class='month'><%= month %> <%= year %></div><div class='clndr-control-button rightalign'><span class='clndr-next-button'>next</span></div></div><table class='clndr-table' border='0' cellspacing='0' cellpadding='0'><thead><tr class='header-days'><% for(var i = 0; i < daysOfTheWeek.length; i++) { %><td class='header-day'><%= daysOfTheWeek[i] %></td><% } %></tr></thead><tbody><% for(var i = 0; i < numberOfRows; i++){ %><tr><% for(var j = 0; j < 7; j++){ %><% var d = j + i * 7; %><td class='<%= days[d].classes %>'><div class='day-contents'><%= days[d].day %></div></td><% } %></tr><% } %></tbody></table>",f={events:[],ready:null,extras:null,render:null,moment:null,weekOffset:0,constraints:null,forceSixRows:null,selectedDate:null,doneRendering:null,daysOfTheWeek
|