UNPKG

24.7 kBJavaScriptView Raw
1 /*
2 * # Fomantic UI - 2.8.4
3 * https://github.com/fomantic/Fomantic-UI
4 * http://fomantic-ui.com/
5 *
6 * Copyright 2014 Contributors
7 * Released under the MIT license
8 * http://opensource.org/licenses/MIT
9 *
10 */
11!function(he,e,M,x){"use strict";he.isFunction=he.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),he.fn.calendar=function(r){var g,e=he(this),o=e.selector||"",D=(new Date).getTime(),y=[],v=r,b="string"==typeof v,C=[].slice.call(arguments,1),w={5:{row:4,column:3},10:{row:3,column:2},15:{row:2,column:2},20:{row:3,column:1},30:{row:2,column:1}};return e.each(function(){var p,se,ue=he.isPlainObject(r)?he.extend(!0,{},he.fn.calendar.settings,r):he.extend({},he.fn.calendar.settings),de=ue.className,e=ue.namespace,i=ue.selector,fe=ue.formatter,a=ue.parser,pe=ue.metadata,ce=w[ue.minTimeGap],l=ue.error,t="."+e,n="module-"+e,s=he(this),u=s.find(i.input),me=s.find(i.popup),d=s.find(i.activator),f=this,c=s.data(n),m=!1,h=!1;se={initialize:function(){se.debug("Initializing calendar for",f,s),p=se.get.isTouch(),se.setup.config(),se.setup.popup(),se.setup.inline(),se.setup.input(),se.setup.date(),se.create.calendar(),se.bind.events(),se.instantiate()},instantiate:function(){se.verbose("Storing instance of calendar"),c=se,s.data(n,c)},destroy:function(){se.verbose("Destroying previous calendar for",f),s.removeData(n),se.unbind.events()},setup:{config:function(){null!==se.get.minDate()&&se.set.minDate(s.data(pe.minDate)),null!==se.get.maxDate()&&se.set.maxDate(s.data(pe.maxDate)),se.setting("type",se.get.type())},popup:function(){if(!ue.inline&&(d.length||(d=s.children().first()).length))if(he.fn.popup!==x){if(!me.length){var e=d.parent(),t=0!==e.closest(i.append).length?"appendTo":"prependTo";me=he("<div/>").addClass(de.popup)[t](e)}me.addClass(de.calendar);var a=ue.onVisible,n=ue.onHidden;u.length||(me.attr("tabindex","0"),a=function(){return se.focus(),ue.onVisible.apply(me,arguments)},n=function(){return se.blur(),ue.onHidden.apply(me,arguments)});var r=ue.on||(u.length?"focus":"click"),o=he.extend({},ue.popupOptions,{popup:me,on:r,hoverable:"hover"===r,onShow:function(){return se.set.focusDate(se.get.date()),se.set.mode(ue.startMode),ue.onShow.apply(me,arguments)},onVisible:a,onHide:ue.onHide,onHidden:n});se.popup(o)}else se.error(l.popup)},inline:function(){d.length&&!ue.inline||(me=he("<div/>").addClass(de.calendar).appendTo(s),u.length||me.attr("tabindex","0"))},input:function(){ue.touchReadonly&&u.length&&p&&u.prop("readonly",!0)},date:function(){var e;ue.initialDate?e=a.date(ue.initialDate,ue):s.data(pe.date)!==x?e=a.date(s.data(pe.date),ue):u.length&&(e=a.date(u.val(),ue)),se.set.date(e,ue.formatInput,!1)}},create:{calendar:function(){var e,t,a,n,r,o,i,l=se.get.mode(),s=new Date,u=se.get.date(),d=se.get.focusDate(),f=d||u||ue.initialDate||s;f=se.helper.dateInRange(f),d||(d=f,se.set.focusDate(d,!1,!1));var p="year"===l,c="month"===l,m="day"===l,h="hour"===l,g="minute"===l,D="time"===ue.type,y=Math.max(ue.multiMonth,1),v=m?se.get.monthOffset():0,b=f.getMinutes(),C=f.getHours(),w=f.getDate(),M=f.getMonth()+v,x=f.getFullYear(),T=m?ue.showWeekNumbers?8:7:h?4:ce.column,k=m||h?6:ce.row,O=m?y:1,F=me,N=F.hasClass("left")?"right center":"left center";for(F.empty(),1<O&&(i=he("<div/>").addClass(de.grid).appendTo(F)),n=0;n<O;n++){if(1<O)F=he("<div/>").addClass(de.column).appendTo(i);var A=M+n,H=(new Date(x,A,1).getDay()-ue.firstDayOfWeek%7+7)%7;if(!ue.constantHeight&&m){var Y=new Date(x,A+1,0).getDate()+H;k=Math.ceil(Y/7)}var I=p?10:c?1:0,E=m?1:0,j=h||g?1:0,q=h||g?w:1,W=new Date(x-I,A-E,q-j,C),R=new Date(x+I,A+E,q+j,C),S=p?new Date(10*Math.ceil(x/10)-9,0,0):c?new Date(x,0,0):m?new Date(x,A,0):new Date(x,A,w,-1),V=p?new Date(10*Math.ceil(x/10)+1,0,1):c?new Date(x+1,0,1):m?new Date(x,A+1,1):new Date(x,A,w+1),G=l;m&&ue.showWeekNumbers&&(G+=" andweek");var P=he("<table/>").addClass(de.table).addClass(G).appendTo(F),B=T;if(!D){var K=he("<thead/>").appendTo(P);r=he("<tr/>").appendTo(K),o=he("<th/>").attr("colspan",""+T).appendTo(r);var U=p||c?new Date(x,0,1):m?new Date(x,A,1):new Date(x,A,w,C,b),J=he("<span/>").addClass(de.link).appendTo(o);J.text(fe.header(U,l,ue));var z=c?ue.disableYear?"day":"year":m?ue.disableMonth?"year":"month":"day";if(J.data(pe.mode,z),0===n){var L=he("<span/>").addClass(de.prev).appendTo(o);L.data(pe.focusDate,W),L.toggleClass(de.disabledCell,!se.helper.isDateInRange(S,l)),he("<i/>").addClass(de.prevIcon).appendTo(L)}if(n===O-1){var $=he("<span/>").addClass(de.next).appendTo(o);$.data(pe.focusDate,R),$.toggleClass(de.disabledCell,!se.helper.isDateInRange(V,l)),he("<i/>").addClass(de.nextIcon).appendTo($)}if(m)for(r=he("<tr/>").appendTo(K),ue.showWeekNumbers&&((o=he("<th/>").appendTo(r)).text(ue.text.weekNo),o.addClass(de.weekCell),B--),e=0;e<B;e++)(o=he("<th/>").appendTo(r)).text(fe.dayColumnHeader((e+ue.firstDayOfWeek)%7,ue))}var Q=he("<tbody/>").appendTo(P);for(e=p?10*Math.ceil(x/10)-9:m?1-H:0,t=0;t<k;t++)for(r=he("<tr/>").appendTo(Q),m&&ue.showWeekNumbers&&((o=he("<th/>").appendTo(r)).text(se.get.weekOfYear(x,A,e+1-ue.firstDayOfWeek)),o.addClass(de.weekCell)),a=0;a<B;a++,e++){var Z=p?new Date(e,A,1,C,b):c?new Date(x,e,1,C,b):m?new Date(x,A,e,C,b):h?new Date(x,A,w,e):new Date(x,A,w,C,e*ue.minTimeGap),X=p?e:c?ue.text.monthsShort[e]:m?Z.getDate():fe.time(Z,ue,!0);(o=he("<td/>").addClass(de.cell).appendTo(r)).text(X),o.data(pe.date,Z);var _=m&&Z.getMonth()!==(A+12)%12,ee=!ue.selectAdjacentDays&&_||!se.helper.isDateInRange(Z,l)||ue.isDisabled(Z,l)||se.helper.isDisabled(Z,l)||!se.helper.isEnabled(Z,l);if(ee){var te=se.helper.findDayAsObject(Z,l,ue.disabledDates);null!==te&&te[pe.message]&&(o.attr("data-tooltip",te[pe.message]),o.attr("data-position",N))}else{var ae=se.helper.findDayAsObject(Z,l,ue.eventDates);null!==ae&&(o.addClass(ae[pe.class]||ue.eventClass),ae[pe.message]&&(o.attr("data-tooltip",ae[pe.message]),o.attr("data-position",N)))}var ne=se.helper.dateEqual(Z,u,l),re=se.helper.dateEqual(Z,s,l);o.toggleClass(de.adjacentCell,_),o.toggleClass(de.disabledCell,ee),o.toggleClass(de.activeCell,ne&&!_),h||g||o.toggleClass(de.todayCell,!_&&re);var oe={mode:l,adjacent:_,disabled:ee,active:ne,today:re};fe.cell(o,Z,oe),se.helper.dateEqual(Z,d,l)&&se.set.focusDate(Z,!1,!1)}if(ue.today){var ie=he("<tr/>").appendTo(Q),le=he("<td/>").attr("colspan",""+T).addClass(de.today).appendTo(ie);le.text(fe.today(ue)),le.data(pe.date,s)}se.update.focus(!1,P)}}},update:{focus:function(e,t){t=t||me;var l=se.get.mode(),a=se.get.date(),s=se.get.focusDate(),u=se.get.startDate(),d=se.get.endDate(),f=(e?s:null)||a||(p?null:s);t.find("td").each(function(){var e=he(this),t=e.data(pe.date);if(t){var a=e.hasClass(de.disabledCell),n=e.hasClass(de.activeCell),r=e.hasClass(de.adjacentCell),o=se.helper.dateEqual(t,s,l),i=!!f&&(!!u&&se.helper.isDateInRange(t,l,u,f)||!!d&&se.helper.isDateInRange(t,l,f,d));e.toggleClass(de.focusCell,o&&(!p||m)&&(!r||ue.selectAdjacentDays&&r)&&!a),se.helper.isTodayButton(e)||e.toggleClass(de.rangeCell,i&&!n&&!a)}})}},refresh:function(){se.create.calendar()},bind:{events:function(){se.debug("Binding events"),me.on("mousedown"+t,se.event.mousedown),me.on("touchstart"+t,se.event.mousedown),me.on("mouseup"+t,se.event.mouseup),me.on("touchend"+t,se.event.mouseup),me.on("mouseover"+t,se.event.mouseover),u.length?(u.on("input"+t,se.event.inputChange),u.on("focus"+t,se.event.inputFocus),u.on("blur"+t,se.event.inputBlur),u.on("click"+t,se.event.inputClick),u.on("keydown"+t,se.event.keydown)):me.on("keydown"+t,se.event.keydown)}},unbind:{events:function(){se.debug("Unbinding events"),me.off(t),u.length&&u.off(t)}},event:{mouseover:function(e){var t=he(e.target).data(pe.date),a=1===e.buttons;t&&se.set.focusDate(t,!1,!0,a)},mousedown:function(e){u.length&&e.preventDefault(),m=0<=e.type.indexOf("touch");var t=he(e.target).data(pe.date);t&&se.set.focusDate(t,!1,!0,!0)},mouseup:function(e){se.focus(),e.preventDefault(),e.stopPropagation(),m=!1;var t=he(e.target);if(!t.hasClass("disabled")){var a=t.parent();(a.data(pe.date)||a.data(pe.focusDate)||a.data(pe.mode))&&(t=a);var n=t.data(pe.date),r=t.data(pe.focusDate),o=t.data(pe.mode);if(n&&!1!==ue.onSelect.call(f,n,se.get.mode())){var i=t.hasClass(de.today);se.selectDate(n,i)}else r?se.set.focusDate(r):o&&se.set.mode(o)}},keydown:function(e){var t=e.which;if(27!==t&&9!==t||se.popup("hide"),se.popup("is visible"))if(37===t||38===t||39===t||40===t){var a="day"===(f=se.get.mode())?7:"hour"===f?4:"minute"===f?ce.column:3,n=37===t?-1:38===t?-a:39==t?1:a;n*="minute"===f?ue.minTimeGap:1;var r=se.get.focusDate()||se.get.date()||new Date,o=r.getFullYear()+("year"===f?n:0),i=r.getMonth()+("month"===f?n:0),l=r.getDate()+("day"===f?n:0),s=r.getHours()+("hour"===f?n:0),u=r.getMinutes()+("minute"===f?n:0),d=new Date(o,i,l,s,u);"time"===ue.type&&(d=se.helper.mergeDateTime(r,d)),se.helper.isDateInRange(d,f)&&se.set.focusDate(d)}else if(13===t){var f=se.get.mode(),p=se.get.focusDate();p&&!ue.isDisabled(p,f)&&!se.helper.isDisabled(p,f)&&se.helper.isEnabled(p,f)&&se.selectDate(p),e.preventDefault(),e.stopPropagation()}38!==t&&40!==t||(e.preventDefault(),se.popup("show"))},inputChange:function(){var e=u.val(),t=a.date(e,ue);se.set.date(t,!1)},inputFocus:function(){me.addClass(de.active)},inputBlur:function(){if(me.removeClass(de.active),ue.formatInput){var e=se.get.date(),t=fe.datetime(e,ue);u.val(t)}},inputClick:function(){se.popup("show")}},get:{weekOfYear:function(e,t,a){var n,r,o;return n=Date.UTC(e,t,a+3)/864e5,r=Math.floor(n/7),o=new Date(6048e5*r).getUTCFullYear(),r-Math.floor(Date.UTC(o,0,7)/6048e5)+1},date:function(){return se.helper.sanitiseDate(s.data(pe.date))||null},inputDate:function(){return u.val()},focusDate:function(){return s.data(pe.focusDate)||null},startDate:function(){var e=se.get.calendarModule(ue.startCalendar);return(e?e.get.date():s.data(pe.startDate))||null},endDate:function(){var e=se.get.calendarModule(ue.endCalendar);return(e?e.get.date():s.data(pe.endDate))||null},minDate:function(){return s.data(pe.minDate)||null},maxDate:function(){return s.data(pe.maxDate)||null},monthOffset:function(){return s.data(pe.monthOffset)||0},mode:function(){var e=s.data(pe.mode)||ue.startMode,t=se.get.validModes();return 0<=he.inArray(e,t)?e:"time"===ue.type?"hour":"month"===ue.type?"month":"year"===ue.type?"year":"day"},type:function(){return s.data(pe.type)||ue.type},validModes:function(){var e=[];return"time"!==ue.type&&(ue.disableYear&&"year"!==ue.type||e.push("year"),(ue.disableMonth||"year"===ue.type)&&"month"!==ue.type||e.push("month"),0<=ue.type.indexOf("date")&&e.push("day")),0<=ue.type.indexOf("time")&&(e.push("hour"),ue.disableMinute||e.push("minute")),e},isTouch:function(){try{return M.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e instanceof he||(e=he(e).first()),e.data(n)):null}},set:{date:function(e,t,a){t=!1!==t,a=!1!==a,e=se.helper.sanitiseDate(e),e=se.helper.dateInRange(e);var n=se.get.mode(),r=fe.datetime(e,ue);if(a&&!1===ue.onBeforeChange.call(f,e,r,n))return!1;if(se.set.focusDate(e),ue.isDisabled(e,n))return!1;var o=se.get.endDate();o&&e&&o<e&&se.set.endDate(x),se.set.dataKeyValue(pe.date,e),t&&u.length&&u.val(r),a&&ue.onChange.call(f,e,r,n)},startDate:function(e,t){e=se.helper.sanitiseDate(e);var a=se.get.calendarModule(ue.startCalendar);a&&a.set.date(e),se.set.dataKeyValue(pe.startDate,e,t)},endDate:function(e,t){e=se.helper.sanitiseDate(e);var a=se.get.calendarModule(ue.endCalendar);a&&a.set.date(e),se.set.dataKeyValue(pe.endDate,e,t)},focusDate:function(e,t,a,n){e=se.helper.sanitiseDate(e),e=se.helper.dateInRange(e);var r="day"===se.get.mode(),o=se.get.focusDate();if(r&&e&&o){var i=12*(e.getFullYear()-o.getFullYear())+e.getMonth()-o.getMonth();if(i){var l=se.get.monthOffset()-i;se.set.monthOffset(l,!1)}}var s=se.set.dataKeyValue(pe.focusDate,e,t);a=!1!==a&&s&&!1===t||h!=n,h=n,a&&se.update.focus(n)},minDate:function(e){e=se.helper.sanitiseDate(e),null!==ue.maxDate&&ue.maxDate<=e?se.verbose("Unable to set minDate variable bigger that maxDate variable",e,ue.maxDate):(se.setting("minDate",e),se.set.dataKeyValue(pe.minDate,e))},maxDate:function(e){e=se.helper.sanitiseDate(e),null!==ue.minDate&&ue.minDate>=e?se.verbose("Unable to set maxDate variable lower that minDate variable",e,ue.minDate):(se.setting("maxDate",e),se.set.dataKeyValue(pe.maxDate,e))},monthOffset:function(e,t){var a=Math.max(ue.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),se.set.dataKeyValue(pe.monthOffset,e,t)},mode:function(e,t){se.set.dataKeyValue(pe.mode,e,t)},dataKeyValue:function(e,t,a){var n=s.data(e),r=n===t||n<=t&&t<=n;return t?s.data(e,t):s.removeData(e),(a=!1!==a&&!r)&&se.refresh(),!r}},selectDate:function(e,t){se.verbose("New date selection",e);var a=se.get.mode();if(t||"minute"===a||ue.disableMinute&&"hour"===a||"date"===ue.type&&"day"===a||"month"===ue.type&&"month"===a||"year"===ue.type&&"year"===a){if(!(!1===se.set.date(e))&&ue.closable){se.popup("hide");var n=se.get.calendarModule(ue.endCalendar);n&&(n.popup("show"),n.focus())}}else{var r="year"===a?ue.disableMonth?"day":"month":"month"===a?"day":"day"===a?"hour":"minute";se.set.mode(r),"hour"===a||"day"===a&&se.get.date()?se.set.date(e):se.set.focusDate(e)}},changeDate:function(e){se.set.date(e)},clear:function(){se.set.date(x)},popup:function(){return d.popup.apply(d,arguments)},focus:function(){u.length?u.focus():me.focus()},blur:function(){u.length?u.blur():me.blur()},helper:{isDisabled:function(a,n){return("day"===n||"month"===n||"year"===n)&&(-1!==ue.disabledDaysOfWeek.indexOf(a.getDay())||ue.disabledDates.some(function(e){if("string"==typeof e&&(e=se.helper.sanitiseDate(e)),e instanceof Date)return se.helper.dateEqual(a,e,n);if(null!==e&&"object"==typeof e)if(e[pe.year]){if("number"==typeof e[pe.year])return a.getFullYear()==e[pe.year];if(Array.isArray(e[pe.year]))return-1<e[pe.year].indexOf(a.getFullYear())}else if(e[pe.month]){if("number"==typeof e[pe.month])return a.getMonth()==e[pe.month];if(Array.isArray(e[pe.month]))return-1<e[pe.month].indexOf(a.getMonth());if(e[pe.month]instanceof Date){var t=se.helper.sanitiseDate(e[pe.month]);return a.getMonth()==t.getMonth()&&a.getFullYear()==t.getFullYear()}}else if(e[pe.date]&&"day"===n){if(e[pe.date]instanceof Date)return se.helper.dateEqual(a,se.helper.sanitiseDate(e[pe.date]),n);if(Array.isArray(e[pe.date]))return e[pe.date].some(function(e){return se.helper.dateEqual(a,e,n)})}}))},isEnabled:function(t,a){return"day"!==a||(0===ue.enabledDates.length||ue.enabledDates.some(function(e){return"string"==typeof e&&(e=se.helper.sanitiseDate(e)),e instanceof Date?se.helper.dateEqual(t,e,a):null!==e&&"object"==typeof e&&e[pe.date]?se.helper.dateEqual(t,se.helper.sanitiseDate(e[pe.date]),a):void 0}))},findDayAsObject:function(t,a,e){if("day"===a||"month"===a||"year"===a)for(var n,r=0;r<e.length;r++){if("string"==typeof(n=e[r])&&(n=se.helper.sanitiseDate(n)),n instanceof Date&&se.helper.dateEqual(t,n,a)){var o={};return o[pe.date]=n,o}if(null!==n&&"object"==typeof n)if(n[pe.year]){if("number"==typeof n[pe.year]&&t.getFullYear()==n[pe.year])return n;if(Array.isArray(n[pe.year])&&-1<n[pe.year].indexOf(t.getFullYear()))return n}else if(n[pe.month]){if("number"==typeof n[pe.month]&&t.getMonth()==n[pe.month])return n;if(Array.isArray(n[pe.month])){if(-1<n[pe.month].indexOf(t.getMonth()))return n}else if(n[pe.month]instanceof Date){var i=se.helper.sanitiseDate(n[pe.month]);if(t.getMonth()==i.getMonth()&&t.getFullYear()==i.getFullYear())return n}}else if(n[pe.date]&&"day"===a){if(n[pe.date]instanceof Date&&se.helper.dateEqual(t,se.helper.sanitiseDate(n[pe.date]),a))return n;if(Array.isArray(n[pe.date])&&n[pe.date].some(function(e){return se.helper.dateEqual(t,e,a)}))return n}}return null},sanitiseDate:function(e){return e?(e instanceof Date||(e=a.date(""+e,ue)),!e||null===e||isNaN(e.getTime())?x:e):x},dateDiff:function(e,t,a){a=a||"day";var n="time"===ue.type,r="year"===a,o=r||"month"===a,i="minute"===a,l=i||"hour"===a;return e=new Date(n?2e3:e.getFullYear(),n?0:r?0:e.getMonth(),n?1:o?1:e.getDate(),l?e.getHours():0,i?ue.minTimeGap*Math.floor(e.getMinutes()/ue.minTimeGap):0),(t=new Date(n?2e3:t.getFullYear(),n?0:r?0:t.getMonth(),n?1:o?1:t.getDate(),l?t.getHours():0,i?ue.minTimeGap*Math.floor(t.getMinutes()/ue.minTimeGap):0)).getTime()-e.getTime()},dateEqual:function(e,t,a){return!!e&&!!t&&0===se.helper.dateDiff(e,t,a)},isDateInRange:function(e,t,a,n){if(!a&&!n){var r=se.get.startDate();a=r&&ue.minDate?new Date(Math.max(r,ue.minDate)):r||ue.minDate,n=ue.maxDate}return a=a&&new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),ue.minTimeGap*Math.ceil(a.getMinutes()/ue.minTimeGap)),!(!e||a&&0<se.helper.dateDiff(e,a,t)||n&&0<se.helper.dateDiff(n,e,t))},dateInRange:function(e,t,a){if(!t&&!a){var n=se.get.startDate();t=n&&ue.minDate?new Date(Math.max(n,ue.minDate)):n||ue.minDate,a=ue.maxDate}t=t&&new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),ue.minTimeGap*Math.ceil(t.getMinutes()/ue.minTimeGap));var r="time"===ue.type;return e?t&&0<se.helper.dateDiff(e,t,"minute")?r?se.helper.mergeDateTime(e,t):t:a&&0<se.helper.dateDiff(a,e,"minute")?r?se.helper.mergeDateTime(e,a):a:e:e},mergeDateTime:function(e,t){return e&&t?new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()):t},isTodayButton:function(e){return e.text()===ue.text.today}},setting:function(e,t){if(se.debug("Changing setting",e,t),he.isPlainObject(e))he.extend(!0,ue,e);else{if(t===x)return ue[e];he.isPlainObject(ue[e])?he.extend(!0,ue[e],t):ue[e]=t}},internal:function(e,t){if(he.isPlainObject(e))he.extend(!0,se,e);else{if(t===x)return se[e];se[e]=t}},debug:function(){!ue.silent&&ue.debug&&(ue.performance?se.performance.log(arguments):(se.debug=Function.prototype.bind.call(console.info,console,ue.name+":"),se.debug.apply(console,arguments)))},verbose:function(){!ue.silent&&ue.verbose&&ue.debug&&(ue.performance?se.performance.log(arguments):(se.verbose=Function.prototype.bind.call(console.info,console,ue.name+":"),se.verbose.apply(console,arguments)))},error:function(){ue.silent||(se.error=Function.prototype.bind.call(console.error,console,ue.name+":"),se.error.apply(console,arguments))},performance:{log:function(e){var t,a;ue.performance&&(a=(t=(new Date).getTime())-(D||t),D=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:f,"Execution Time":a})),clearTimeout(se.performance.timer),se.performance.timer=setTimeout(se.performance.display,500)},display:function(){var e=ue.name+":",a=0;D=!1,clearTimeout(se.performance.timer),he.each(y,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",o&&(e+=" '"+o+"'"),(console.group!==x||console.table!==x)&&0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):he.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(n,e,t){var r,o,a,i=c;return e=e||C,t=f||t,"string"==typeof n&&i!==x&&(n=n.split(/[\. ]/),r=n.length-1,he.each(n,function(e,t){var a=e!=r?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(he.isPlainObject(i[a])&&e!=r)i=i[a];else{if(i[a]!==x)return o=i[a],!1;if(!he.isPlainObject(i[t])||e==r)return i[t]!==x?o=i[t]:se.error(l.method,n),!1;i=i[t]}})),he.isFunction(o)?a=o.apply(t,e):o!==x&&(a=o),Array.isArray(g)?g.push(a):g!==x?g=[g,a]:a!==x&&(g=a),o}},b?(c===x&&se.initialize(),se.invoke(v)):(c!==x&&c.invoke("destroy"),se.initialize())}),g!==x?g:this},he.fn.calendar.settings={name:"Calendar",namespace:"calendar",silent:!1,debug:!1,verbose:!1,performance:!1,type:"datetime",firstDayOfWeek:0,constantHeight:!0,today:!1,closable:!0,monthFirst:!0,touchReadonly:!0,inline:!1,on:null,initialDate:null,startMode:!1,minDate:null,maxDate:null,ampm:!0,disableYear:!1,disableMonth:!1,disableMinute:!1,formatInput:!0,startCalendar:null,endCalendar:null,multiMonth:1,minTimeGap:5,showWeekNumbers:null,disabledDates:[],disabledDaysOfWeek:[],enabledDates:[],eventDates:[],centuryBreak:60,currentCentury:2e3,selectAdjacentDays:!1,popupOptions:{position:"bottom left",lastResort:"bottom left",prefer:"opposite",hideOnScroll:!1},text:{days:["S","M","T","W","T","F","S"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",now:"Now",am:"AM",pm:"PM",weekNo:"Week"},formatter:{header:function(e,t,a){return"year"===t?a.formatter.yearHeader(e,a):"month"===t?a.formatter.monthHeader(e,a):"day"===t?a.formatter.dayHeader(e,a):"hour"===t?a.formatter.hourHeader(e,a):a.formatter.minuteHeader(e,a)},yearHeader:function(e,t){var a=10*Math.ceil(e.getFullYear()/10);return a-9+" - "+(2+a)},monthHeader:function(e,t){return e.getFullYear()},dayHeader:function(e,t){return t.text.months[e.getMonth()]+" "+e.getFullYear()},hourHeader:function(e,t){return t.formatter.date(e,t)},minuteHeader:function(e,t){return t.formatter.date(e,t)},dayColumnHeader:function(e,t){return t.text.days[e]},datetime:function(e,t){if(!e)return"";var a="time"===t.type?"":t.formatter.date(e,t),n=t.type.indexOf("time")<0?"":t.formatter.time(e,t,!1);return a+("datetime"===t.type?" ":"")+n},date:function(e,t){if(!e)return"";var a=e.getDate(),n=t.text.months[e.getMonth()],r=e.getFullYear();return"year"===t.type?r:"month"===t.type?n+" "+r:(t.monthFirst?n+" "+a:a+" "+n)+", "+r},time:function(e,t,a){if(!e)return"";var n=e.getHours(),r=e.getMinutes(),o="";return t.ampm&&(o=" "+(n<12?t.text.am:t.text.pm),n=0===n?12:12<n?n-12:n),n+":"+(r<10?"0":"")+r+o},today:function(e){return"date"===e.type?e.text.today:e.text.now},cell:function(e,t,a){}},parser:{date:function(e,t){if(e instanceof Date)return e;if(!e)return null;if(0===(e=(""+e).trim().toLowerCase()).length)return null;e=t.monthFirst?e:e.replace(/[\/\-\.]/g,"/").replace(/([0-9]+)\/([0-9]+)/,"$2/$1");var a,n,r,o=new Date(e);if(!isNaN(o.getDate()))return o;var i,l,s,u=-1,d=-1,f=-1,p=-1,c=-1,m=x,h="time"===t.type,g=t.type.indexOf("time")<0,D=e.split(t.regExp.dateWords),y=e.split(t.regExp.dateNumbers);if(!g)for(m=0<=he.inArray(t.text.am.toLowerCase(),D)||!(0<=he.inArray(t.text.pm.toLowerCase(),D))&&x,a=0;a<y.length;a++)if(0<=(l=y[a]).indexOf(":")){if(d<0||u<0)for(s=l.split(":"),r=0;r<Math.min(2,s.length);r++)n=parseInt(s[r]),isNaN(n)&&(n=0),0===r?d=n%24:u=n%60;y.splice(a,1)}if(!h){for(a=0;a<D.length;a++)if(!((i=D[a]).length<=0)){for(n=0;n<t.text.months.length;n++)if(t.text.months[n].substring(0,i.length).toLowerCase()===i){p=n+1;break}if(0<=p)break}for(a=0;a<y.length;a++)if(n=parseInt(y[a]),!isNaN(n)&&n>=t.centuryBreak&&a===y.length-1){n<=99&&(n+=t.currentCentury-100),c=n,y.splice(a,1);break}if(p<0)for(a=0;a<y.length;a++)if(r=1<a||t.monthFirst?a:1===a?0:1,n=parseInt(y[r]),!isNaN(n)&&1<=n&&n<=12){p=n,y.splice(r,1);break}for(a=0;a<y.length;a++)if(n=parseInt(y[a]),!isNaN(n)&&1<=n&&n<=31){f=n,y.splice(a,1);break}if(c<0)for(a=y.length-1;0<=a;a--)if(n=parseInt(y[a]),!isNaN(n)){n<=99&&(n+=t.currentCentury),c=n,y.splice(a,1);break}}if(!g){if(d<0)for(a=0;a<y.length;a++)if(n=parseInt(y[a]),!isNaN(n)&&0<=n&&n<=23){d=n,y.splice(a,1);break}if(u<0)for(a=0;a<y.length;a++)if(n=parseInt(y[a]),!isNaN(n)&&0<=n&&n<=59){u=n,y.splice(a,1);break}}if(u<0&&d<0&&f<0&&p<0&&c<0)return null;u<0&&(u=0),d<0&&(d=0),f<0&&(f=1),p<0&&(p=1),c<0&&(c=(new Date).getFullYear()),m!==x&&(m?12===d&&(d=0):d<12&&(d+=12));var v=new Date(c,p-1,f,d,u);return v.getMonth()===p-1&&v.getFullYear()===c||(v=new Date(c,p,0,d,u)),isNaN(v.getTime())?null:v}},onBeforeChange:function(e,t,a){return!0},onChange:function(e,t,a){},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},onSelect:function(e,t){},isDisabled:function(e,t){return!1},selector:{popup:".ui.popup",input:"input",activator:"input",append:".inline.field,.inline.fields"},regExp:{dateWords:/[^A-Za-z\u00C0-\u024F]+/g,dateNumbers:/[^\d:]+/g},error:{popup:"UI Popup, a required component is not included in this page",method:"The method you called is not defined."},className:{calendar:"calendar",active:"active",popup:"ui popup",grid:"ui equal width grid",column:"column",table:"ui celled center aligned unstackable table",prev:"prev link",next:"next link",prevIcon:"chevron left icon",nextIcon:"chevron right icon",link:"link",cell:"link",disabledCell:"disabled",weekCell:"disabled",adjacentCell:"adjacent",activeCell:"active",rangeCell:"range",focusCell:"focus",todayCell:"today",today:"today link"},metadata:{date:"date",focusDate:"focusDate",startDate:"startDate",endDate:"endDate",minDate:"minDate",maxDate:"maxDate",mode:"mode",type:"type",monthOffset:"monthOffset",message:"message",class:"class",month:"month",year:"year"},eventClass:"blue"}}(jQuery,window,document);
\No newline at end of file