mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-17 06:35:14 +08:00
3 lines
23 KiB
JavaScript
3 lines
23 KiB
JavaScript
|
/*! clndr.min.js v1.5.1 2019-11-27 */
|
||
|
|
||
|
!function(t){"function"==typeof define&&define.amd?define(["jquery","moment"],t):"object"==typeof exports?t(require("jquery"),require("moment")):t(jQuery,moment)}(function(p,u){var a={events:[],ready:null,extras:null,render:null,moment:null,weekOffset:0,constraints:null,forceSixRows:null,selectedDate:null,doneRendering:null,daysOfTheWeek:null,multiDayEvents:null,startWithMonth:null,dateParameter:"date",template:"<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>",showAdjacentMonths:!0,trackSelectedDate:!1,formatWeekdayHeader:null,adjacentDaysChangeMonth:!1,ignoreInactiveDaysInSelection:null,lengthOfTime:{days:null,interval:1,months:null},clickEvents:{click:null,today:null,nextYear:null,nextMonth:null,nextInterval:null,previousYear:null,onYearChange:null,previousMonth:null,onMonthChange:null,previousInterval:null,onIntervalChange:null},targets:{day:"day",empty:"empty",nextButton:"clndr-next-button",todayButton:"clndr-today-button",previousButton:"clndr-previous-button",nextYearButton:"clndr-next-year-button",previousYearButton:"clndr-previous-year-button"},classes:{past:"past",today:"today",event:"event",inactive:"inactive",selected:"selected",lastMonth:"last-month",nextMonth:"next-month",adjacentMonth:"adjacent-month"}};function n(t,e){var n,s;this.element=t,this.options=p.extend(!0,{},a,e),this.options.moment&&(u=this.options.moment),this.validateOptions(),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=u(this.options.lengthOfTime.startDate).startOf("month"):this.options.startWithMonth?this.intervalStart=u(this.options.startWithMonth).startOf("month"):this.intervalStart=u().startOf("month"),this.intervalEnd=u(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=u(this.options.lengthOfTime.startDate).startOf("day"):this.intervalStart=u().weekday(this.options.weekOffset).startOf("day"),this.intervalEnd=u(this.intervalStart).add(this.options.lengthOfTime.days-1,"days").endOf("day"),this.month=this.intervalStart.clone()):(this.month=u().startOf("month"),this.intervalStart=u(this.month),this.intervalEnd=u(this.month).endOf("month")),this.options.startWithMonth&&(this.month=u(this.options.startWithMonth).startOf("month"),this.intervalStart=u(this.month),this.intervalEnd=this.options.lengthOfTime.days?u(this.month).add(this.options.lengthOfTime.days-1,"days").endOf("day"):u(this.month).endOf("month")),this.options.constraints&&(this.options.constraints.startDate&&(s=u(this.options.constraints.startDate),this.options.lengthOfTime.days?(this.intervalStart.isBefore(s,"week")&&(this.intervalStart=s.startOf("week")),(this.intervalStart.diff(this.intervalEnd,"days")<this.options.lengthOfTime.days||this.intervalEnd.isBefore(this.intervalStart))&&(this.intervalEnd=u(this.intervalStart).add(this.options.lengthOfTime.days-1,"days").endOf("day"),this.month=this.intervalStart.clone())):(this.inter
|