1234567891011 |
- /*
- * # Fomantic UI - 2.8.4
- * https://github.com/fomantic/Fomantic-UI
- * http://fomantic-ui.com/
- *
- * Copyright 2014 Contributors
- * Released under the MIT license
- * http://opensource.org/licenses/MIT
- *
- */
- !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 c,se=he.isPlainObject(r)?he.extend(!0,{},he.fn.calendar.settings,r):he.extend({},he.fn.calendar.settings),ue=se.className,e=se.namespace,i=se.selector,de=se.formatter,a=se.parser,pe=se.metadata,ce=w[se.minTimeGap],l=se.error,t="."+e,n="module-"+e,s=he(this),u=s.find(i.input),fe=s.find(i.popup),d=s.find(i.activator),p=this,f=s.data(n),m=!1,h=!1,me={initialize:function(){me.debug("Initializing calendar for",p,s),c=me.get.isTouch(),me.setup.config(),me.setup.popup(),me.setup.inline(),me.setup.input(),me.setup.date(),me.create.calendar(),me.bind.events(),me.instantiate()},instantiate:function(){me.verbose("Storing instance of calendar"),f=me,s.data(n,f)},destroy:function(){me.verbose("Destroying previous calendar for",p),s.removeData(n),me.unbind.events()},setup:{config:function(){null!==me.get.minDate()&&me.set.minDate(s.data(pe.minDate)),null!==me.get.maxDate()&&me.set.maxDate(s.data(pe.maxDate)),me.setting("type",me.get.type())},popup:function(){var e,t,a,n,r,o;se.inline||(d.length||(d=s.children().first()).length)&&(he.fn.popup!==x?(fe.length||(t=0!==(e=d.parent()).closest(i.append).length?"appendTo":"prependTo",fe=he("<div/>").addClass(ue.popup)[t](e)),fe.addClass(ue.calendar),a=se.onVisible,n=se.onHidden,u.length||(fe.attr("tabindex","0"),a=function(){return me.focus(),se.onVisible.apply(fe,arguments)},n=function(){return me.blur(),se.onHidden.apply(fe,arguments)}),r=se.on||(u.length?"focus":"click"),o=he.extend({},se.popupOptions,{popup:fe,on:r,hoverable:"hover"===r,onShow:function(){return me.set.focusDate(me.get.date()),me.set.mode(se.startMode),se.onShow.apply(fe,arguments)},onVisible:a,onHide:se.onHide,onHidden:n}),me.popup(o)):me.error(l.popup))},inline:function(){d.length&&!se.inline||(fe=he("<div/>").addClass(ue.calendar).appendTo(s),u.length||fe.attr("tabindex","0"))},input:function(){se.touchReadonly&&u.length&&c&&u.prop("readonly",!0)},date:function(){var e;se.initialDate?e=a.date(se.initialDate,se):s.data(pe.date)!==x?e=a.date(s.data(pe.date),se):u.length&&(e=a.date(u.val(),se)),me.set.date(e,se.formatInput,!1)}},create:{calendar:function(){var e,t,a,n=me.get.mode(),r=new Date,o=me.get.date(),i=me.get.focusDate(),l=i||o||se.initialDate||r,l=me.helper.dateInRange(l);i||(i=l,me.set.focusDate(i,!1,!1));var s="year"===n,u="month"===n,d="day"===n,p="hour"===n,c="minute"===n,f="time"===se.type,m=Math.max(se.multiMonth,1),h=d?me.get.monthOffset():0,g=l.getMinutes(),D=l.getHours(),y=l.getDate(),v=l.getMonth()+h,b=l.getFullYear(),C=d?se.showWeekNumbers?8:7:p?4:ce.column,w=d||p?6:ce.row,M=d?m:1,x=fe,T=x.hasClass("left")?"right center":"left center";for(x.empty(),1<M&&(a=he("<div/>").addClass(ue.grid).appendTo(x)),t=0;t<M;t++){1<M&&(x=he("<div/>").addClass(ue.column).appendTo(a));var k,O=v+t,F=(new Date(b,O,1).getDay()-se.firstDayOfWeek%7+7)%7;!se.constantHeight&&d&&(k=new Date(b,O+1,0).getDate()+F,w=Math.ceil(k/7));var N=s?10:u?1:0,A=d?1:0,H=p||c?1:0,Y=p||c?y:1,I=new Date(b-N,O-A,Y-H,D),E=new Date(b+N,O+A,Y+H,D),j=s?new Date(10*Math.ceil(b/10)-9,0,0):u?new Date(b,0,0):d?new Date(b,O,0):new Date(b,O,y,-1),q=s?new Date(10*Math.ceil(b/10)+1,0,1):u?new Date(b+1,0,1):d?new Date(b,O+1,1):new Date(b,O,y+1),W=n;d&&se.showWeekNumbers&&(W+=" andweek");var R=he("<table/>").addClass(ue.table).addClass(W).appendTo(x),S=C;if(!f){var V=he("<thead/>").appendTo(R),G=he("<tr/>").appendTo(V),P=he("<th/>").attr("colspan",""+C).appendTo(G),B=s||u?new Date(b,0,1):d?new Date(b,O,1):new Date(b,O,y,D,g),K=he("<span/>").addClass(ue.link).appendTo(P);K.text(de.header(B,n,se));var U,J,z=u?se.disableYear?"day":"year":d?se.disableMonth?"year":"month":"day";if(K.data(pe.mode,z),0===t&&((U=he("<span/>").addClass(ue.prev).appendTo(P)).data(pe.focusDate,I),U.toggleClass(ue.disabledCell,!me.helper.isDateInRange(j,n)),he("<i/>").addClass(ue.prevIcon).appendTo(U)),t===M-1&&((J=he("<span/>").addClass(ue.next).appendTo(P)).data(pe.focusDate,E),J.toggleClass(ue.disabledCell,!me.helper.isDateInRange(q,n)),he("<i/>").addClass(ue.nextIcon).appendTo(J)),d)for(G=he("<tr/>").appendTo(V),se.showWeekNumbers&&((P=he("<th/>").appendTo(G)).text(se.text.weekNo),P.addClass(ue.weekCell),S--),Z=0;Z<S;Z++)(P=he("<th/>").appendTo(G)).text(de.dayColumnHeader((Z+se.firstDayOfWeek)%7,se))}for(var L,$,Q=he("<tbody/>").appendTo(R),Z=s?10*Math.ceil(b/10)-9:d?1-F:0,X=0;X<w;X++)for(G=he("<tr/>").appendTo(Q),d&&se.showWeekNumbers&&((P=he("<th/>").appendTo(G)).text(me.get.weekOfYear(b,O,Z+1-se.firstDayOfWeek)),P.addClass(ue.weekCell)),e=0;e<S;e++,Z++){var _=s?new Date(Z,O,1,D,g):u?new Date(b,Z,1,D,g):d?new Date(b,O,Z,D,g):p?new Date(b,O,y,Z):new Date(b,O,y,D,Z*se.minTimeGap),ee=s?Z:u?se.text.monthsShort[Z]:d?_.getDate():de.time(_,se,!0);(P=he("<td/>").addClass(ue.cell).appendTo(G)).text(ee),P.data(pe.date,_);var te,ae,ne=d&&_.getMonth()!==(O+12)%12,re=!se.selectAdjacentDays&&ne||!me.helper.isDateInRange(_,n)||se.isDisabled(_,n)||me.helper.isDisabled(_,n)||!me.helper.isEnabled(_,n);re?null!==(te=me.helper.findDayAsObject(_,n,se.disabledDates))&&te[pe.message]&&(P.attr("data-tooltip",te[pe.message]),P.attr("data-position",T)):null!==(ae=me.helper.findDayAsObject(_,n,se.eventDates))&&(P.addClass(ae[pe.class]||se.eventClass),ae[pe.message]&&(P.attr("data-tooltip",ae[pe.message]),P.attr("data-position",T)));var oe=me.helper.dateEqual(_,o,n),ie=me.helper.dateEqual(_,r,n);P.toggleClass(ue.adjacentCell,ne),P.toggleClass(ue.disabledCell,re),P.toggleClass(ue.activeCell,oe&&!ne),p||c||P.toggleClass(ue.todayCell,!ne&&ie);var le={mode:n,adjacent:ne,disabled:re,active:oe,today:ie};de.cell(P,_,le),me.helper.dateEqual(_,i,n)&&me.set.focusDate(_,!1,!1)}se.today&&(L=he("<tr/>").appendTo(Q),($=he("<td/>").attr("colspan",""+C).addClass(ue.today).appendTo(L)).text(de.today(se)),$.data(pe.date,r)),me.update.focus(!1,R)}}},update:{focus:function(e,t){t=t||fe;var l=me.get.mode(),a=me.get.date(),s=me.get.focusDate(),u=me.get.startDate(),d=me.get.endDate(),p=(e?s:null)||a||(c?null:s);t.find("td").each(function(){var e,t,a,n,r,o=he(this),i=o.data(pe.date);i&&(e=o.hasClass(ue.disabledCell),t=o.hasClass(ue.activeCell),a=o.hasClass(ue.adjacentCell),n=me.helper.dateEqual(i,s,l),r=!!p&&(!!u&&me.helper.isDateInRange(i,l,u,p)||!!d&&me.helper.isDateInRange(i,l,p,d)),o.toggleClass(ue.focusCell,n&&(!c||m)&&(!a||se.selectAdjacentDays&&a)&&!e),me.helper.isTodayButton(o)||o.toggleClass(ue.rangeCell,r&&!t&&!e))})}},refresh:function(){me.create.calendar()},bind:{events:function(){me.debug("Binding events"),fe.on("mousedown"+t,me.event.mousedown),fe.on("touchstart"+t,me.event.mousedown),fe.on("mouseup"+t,me.event.mouseup),fe.on("touchend"+t,me.event.mouseup),fe.on("mouseover"+t,me.event.mouseover),u.length?(u.on("input"+t,me.event.inputChange),u.on("focus"+t,me.event.inputFocus),u.on("blur"+t,me.event.inputBlur),u.on("click"+t,me.event.inputClick),u.on("keydown"+t,me.event.keydown)):fe.on("keydown"+t,me.event.keydown)}},unbind:{events:function(){me.debug("Unbinding events"),fe.off(t),u.length&&u.off(t)}},event:{mouseover:function(e){var t=he(e.target).data(pe.date),a=1===e.buttons;t&&me.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&&me.set.focusDate(t,!1,!0,!0)},mouseup:function(e){me.focus(),e.preventDefault(),e.stopPropagation(),m=!1;var t,a,n,r,o,i=he(e.target);i.hasClass("disabled")||(((t=i.parent()).data(pe.date)||t.data(pe.focusDate)||t.data(pe.mode))&&(i=t),a=i.data(pe.date),n=i.data(pe.focusDate),r=i.data(pe.mode),a&&!1!==se.onSelect.call(p,a,me.get.mode())?(o=i.hasClass(ue.today),me.selectDate(a,o)):n?me.set.focusDate(n):r&&me.set.mode(r))},keydown:function(e){var t,a,n,r,o,i,l,s,u,d,p,c=e.which;27!==c&&9!==c||me.popup("hide"),me.popup("is visible")&&(37===c||38===c||39===c||40===c?(t="day"===(d=me.get.mode())?7:"hour"===d?4:"minute"===d?ce.column:3,a=37===c?-1:38===c?-t:39==c?1:t,a*="minute"===d?se.minTimeGap:1,r=(n=me.get.focusDate()||me.get.date()||new Date).getFullYear()+("year"===d?a:0),o=n.getMonth()+("month"===d?a:0),i=n.getDate()+("day"===d?a:0),l=n.getHours()+("hour"===d?a:0),s=n.getMinutes()+("minute"===d?a:0),u=new Date(r,o,i,l,s),"time"===se.type&&(u=me.helper.mergeDateTime(n,u)),me.helper.isDateInRange(u,d)&&me.set.focusDate(u)):13===c&&(d=me.get.mode(),(p=me.get.focusDate())&&!se.isDisabled(p,d)&&!me.helper.isDisabled(p,d)&&me.helper.isEnabled(p,d)&&me.selectDate(p),e.preventDefault(),e.stopPropagation())),38!==c&&40!==c||(e.preventDefault(),me.popup("show"))},inputChange:function(){var e=u.val(),t=a.date(e,se);me.set.date(t,!1)},inputFocus:function(){fe.addClass(ue.active)},inputBlur:function(){var e,t;fe.removeClass(ue.active),se.formatInput&&(e=me.get.date(),t=de.datetime(e,se),u.val(t))},inputClick:function(){me.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 me.helper.sanitiseDate(s.data(pe.date))||null},inputDate:function(){return u.val()},focusDate:function(){return s.data(pe.focusDate)||null},startDate:function(){var e=me.get.calendarModule(se.startCalendar);return(e?e.get.date():s.data(pe.startDate))||null},endDate:function(){var e=me.get.calendarModule(se.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)||se.startMode,t=me.get.validModes();return 0<=he.inArray(e,t)?e:"time"===se.type?"hour":"month"===se.type?"month":"year"===se.type?"year":"day"},type:function(){return s.data(pe.type)||se.type},validModes:function(){var e=[];return"time"!==se.type&&(se.disableYear&&"year"!==se.type||e.push("year"),(se.disableMonth||"year"===se.type)&&"month"!==se.type||e.push("month"),0<=se.type.indexOf("date")&&e.push("day")),0<=se.type.indexOf("time")&&(e.push("hour"),se.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=me.helper.sanitiseDate(e),e=me.helper.dateInRange(e);var n=me.get.mode(),r=de.datetime(e,se);if(a&&!1===se.onBeforeChange.call(p,e,r,n))return!1;if(me.set.focusDate(e),se.isDisabled(e,n))return!1;var o=me.get.endDate();o&&e&&o<e&&me.set.endDate(x),me.set.dataKeyValue(pe.date,e),t&&u.length&&u.val(r),a&&se.onChange.call(p,e,r,n)},startDate:function(e,t){e=me.helper.sanitiseDate(e);var a=me.get.calendarModule(se.startCalendar);a&&a.set.date(e),me.set.dataKeyValue(pe.startDate,e,t)},endDate:function(e,t){e=me.helper.sanitiseDate(e);var a=me.get.calendarModule(se.endCalendar);a&&a.set.date(e),me.set.dataKeyValue(pe.endDate,e,t)},focusDate:function(e,t,a,n){e=me.helper.sanitiseDate(e),e=me.helper.dateInRange(e);var r,o,i="day"===me.get.mode(),l=me.get.focusDate();i&&e&&l&&((r=12*(e.getFullYear()-l.getFullYear())+e.getMonth()-l.getMonth())&&(o=me.get.monthOffset()-r,me.set.monthOffset(o,!1)));var s=me.set.dataKeyValue(pe.focusDate,e,t);a=!1!==a&&s&&!1===t||h!=n,h=n,a&&me.update.focus(n)},minDate:function(e){e=me.helper.sanitiseDate(e),null!==se.maxDate&&se.maxDate<=e?me.verbose("Unable to set minDate variable bigger that maxDate variable",e,se.maxDate):(me.setting("minDate",e),me.set.dataKeyValue(pe.minDate,e))},maxDate:function(e){e=me.helper.sanitiseDate(e),null!==se.minDate&&se.minDate>=e?me.verbose("Unable to set maxDate variable lower that minDate variable",e,se.minDate):(me.setting("maxDate",e),me.set.dataKeyValue(pe.maxDate,e))},monthOffset:function(e,t){var a=Math.max(se.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),me.set.dataKeyValue(pe.monthOffset,e,t)},mode:function(e,t){me.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)&&me.refresh(),!r}},selectDate:function(e,t){me.verbose("New date selection",e);var a,n,r=me.get.mode();t||"minute"===r||se.disableMinute&&"hour"===r||"date"===se.type&&"day"===r||"month"===se.type&&"month"===r||"year"===se.type&&"year"===r?!1!==me.set.date(e)&&se.closable&&(me.popup("hide"),(a=me.get.calendarModule(se.endCalendar))&&(a.popup("show"),a.focus())):(n="year"===r?se.disableMonth?"day":"month":"month"===r?"day":"day"===r?"hour":"minute",me.set.mode(n),"hour"===r||"day"===r&&me.get.date()?me.set.date(e):me.set.focusDate(e))},changeDate:function(e){me.set.date(e)},clear:function(){me.set.date(x)},popup:function(){return d.popup.apply(d,arguments)},focus:function(){u.length?u.focus():fe.focus()},blur:function(){u.length?u.blur():fe.blur()},helper:{isDisabled:function(a,n){return("day"===n||"month"===n||"year"===n)&&(-1!==se.disabledDaysOfWeek.indexOf(a.getDay())||se.disabledDates.some(function(e){if("string"==typeof e&&(e=me.helper.sanitiseDate(e)),e instanceof Date)return me.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=me.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 me.helper.dateEqual(a,me.helper.sanitiseDate(e[pe.date]),n);if(Array.isArray(e[pe.date]))return e[pe.date].some(function(e){return me.helper.dateEqual(a,e,n)})}}))},isEnabled:function(t,a){return"day"!==a||(0===se.enabledDates.length||se.enabledDates.some(function(e){return"string"==typeof e&&(e=me.helper.sanitiseDate(e)),e instanceof Date?me.helper.dateEqual(t,e,a):null!==e&&"object"==typeof e&&e[pe.date]?me.helper.dateEqual(t,me.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=me.helper.sanitiseDate(n)),n instanceof Date&&me.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=me.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&&me.helper.dateEqual(t,me.helper.sanitiseDate(n[pe.date]),a))return n;if(Array.isArray(n[pe.date])&&n[pe.date].some(function(e){return me.helper.dateEqual(t,e,a)}))return n}}return null},sanitiseDate:function(e){return e?(e instanceof Date||(e=a.date(""+e,se)),!e||null===e||isNaN(e.getTime())?x:e):x},dateDiff:function(e,t,a){a=a||"day";var n="time"===se.type,r="year"===a,o=r||"month"===a,i="minute"===a,l=i||"hour"===a;return e=new Date(n?2e3:e.getFullYear(),n||r?0:e.getMonth(),n||o?1:e.getDate(),l?e.getHours():0,i?se.minTimeGap*Math.floor(e.getMinutes()/se.minTimeGap):0),(t=new Date(n?2e3:t.getFullYear(),n||r?0:t.getMonth(),n||o?1:t.getDate(),l?t.getHours():0,i?se.minTimeGap*Math.floor(t.getMinutes()/se.minTimeGap):0)).getTime()-e.getTime()},dateEqual:function(e,t,a){return!!e&&!!t&&0===me.helper.dateDiff(e,t,a)},isDateInRange:function(e,t,a,n){var r;return a||n||(a=(r=me.get.startDate())&&se.minDate?new Date(Math.max(r,se.minDate)):r||se.minDate,n=se.maxDate),a=a&&new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),se.minTimeGap*Math.ceil(a.getMinutes()/se.minTimeGap)),!(!e||a&&0<me.helper.dateDiff(e,a,t)||n&&0<me.helper.dateDiff(n,e,t))},dateInRange:function(e,t,a){var n;t||a||(t=(n=me.get.startDate())&&se.minDate?new Date(Math.max(n,se.minDate)):n||se.minDate,a=se.maxDate),t=t&&new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),se.minTimeGap*Math.ceil(t.getMinutes()/se.minTimeGap));var r="time"===se.type;return e?t&&0<me.helper.dateDiff(e,t,"minute")?r?me.helper.mergeDateTime(e,t):t:a&&0<me.helper.dateDiff(a,e,"minute")?r?me.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()===se.text.today}},setting:function(e,t){if(me.debug("Changing setting",e,t),he.isPlainObject(e))he.extend(!0,se,e);else{if(t===x)return se[e];he.isPlainObject(se[e])?he.extend(!0,se[e],t):se[e]=t}},internal:function(e,t){if(he.isPlainObject(e))he.extend(!0,me,e);else{if(t===x)return me[e];me[e]=t}},debug:function(){!se.silent&&se.debug&&(se.performance?me.performance.log(arguments):(me.debug=Function.prototype.bind.call(console.info,console,se.name+":"),me.debug.apply(console,arguments)))},verbose:function(){!se.silent&&se.verbose&&se.debug&&(se.performance?me.performance.log(arguments):(me.verbose=Function.prototype.bind.call(console.info,console,se.name+":"),me.verbose.apply(console,arguments)))},error:function(){se.silent||(me.error=Function.prototype.bind.call(console.error,console,se.name+":"),me.error.apply(console,arguments))},performance:{log:function(e){var t,a;se.performance&&(a=(t=(new Date).getTime())-(D||t),D=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:p,"Execution Time":a})),clearTimeout(me.performance.timer),me.performance.timer=setTimeout(me.performance.display,500)},display:function(){var e=se.name+":",a=0;D=!1,clearTimeout(me.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=f;return e=e||C,t=p||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]:me.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?(f===x&&me.initialize(),me.invoke(v)):(f!==x&&f.invoke("destroy"),me.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,p=-1,c=-1,f=-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){c=n+1;break}if(0<=c)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),f=n,y.splice(a,1);break}if(c<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){c=n,y.splice(r,1);break}for(a=0;a<y.length;a++)if(n=parseInt(y[a]),!isNaN(n)&&1<=n&&n<=31){p=n,y.splice(a,1);break}if(f<0)for(a=y.length-1;0<=a;a--)if(n=parseInt(y[a]),!isNaN(n)){n<=99&&(n+=t.currentCentury),f=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&&p<0&&c<0&&f<0)return null;u<0&&(u=0),d<0&&(d=0),p<0&&(p=1),c<0&&(c=1),f<0&&(f=(new Date).getFullYear()),m!==x&&(m?12===d&&(d=0):d<12&&(d+=12));var v=new Date(f,c-1,p,d,u);return v.getMonth()===c-1&&v.getFullYear()===f||(v=new Date(f,c,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);
|