diff options
| author | Fuwn <[email protected]> | 2020-12-14 23:29:56 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-12-14 23:29:56 -0800 |
| commit | 002eb44eee98dc838bc854b945ab0cbf4884dd57 (patch) | |
| tree | 428ae460c79baf32fba8ecf16e6fe02a88c3b971 /semantic/dist/components/calendar.min.js | |
| parent | :star: (diff) | |
| download | me-rewrite-angular.tar.xz me-rewrite-angular.zip | |
:star:rewrite-angular
Diffstat (limited to 'semantic/dist/components/calendar.min.js')
| -rw-r--r-- | semantic/dist/components/calendar.min.js | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/semantic/dist/components/calendar.min.js b/semantic/dist/components/calendar.min.js deleted file mode 100644 index f27c64c..0000000 --- a/semantic/dist/components/calendar.min.js +++ /dev/null @@ -1,11 +0,0 @@ - /* - * # Fomantic UI - 2.8.7 - * https://github.com/fomantic/Fomantic-UI - * http://fomantic-ui.com/ - * - * Copyright 2014 Contributors - * Released under the MIT license - * http://opensource.org/licenses/MIT - * - */ -!function(ne,T,k,re){"use strict";ne.isFunction=ne.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},T=void 0!==T&&T.Math==Math?T:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),ne.fn.calendar=function(g){var D,e=ne(this),y=e.selector||"",v=(new Date).getTime(),b=[],C=g,w="string"==typeof C,M=[].slice.call(arguments,1),x={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}},ae=["","one","two","three","four","five","six","seven","eight"];return e.each(function(){var c,e,L=ne.isPlainObject(g)?ne.extend(!0,{},ne.fn.calendar.settings,g):ne.extend({},ne.fn.calendar.settings),$=L.className,t=L.namespace,n=L.selector,Q=L.formatter,a=L.parser,Z=L.metadata,X=x[L.minTimeGap],s=L.error,r="."+t,i="module-"+t,o=ne(this),l=o.find(n.input),_=o.find(n.popup),d=o.find(n.activator),u=this,p=o.data(i),f=!1,ee=o.hasClass($.inverted),m=!1,h=!1,te={initialize:function(){te.debug("Initializing calendar for",u,o),c=te.get.isTouch(),te.setup.config(),te.setup.popup(),te.setup.inline(),te.setup.input(),te.setup.date(),te.create.calendar(),te.bind.events(),te.observeChanges(),te.instantiate()},instantiate:function(){te.verbose("Storing instance of calendar"),p=te,o.data(i,p)},destroy:function(){te.verbose("Destroying previous calendar for",u),o.removeData(i),te.unbind.events(),te.disconnect.classObserver()},setup:{config:function(){null!==te.get.minDate()&&te.set.minDate(o.data(Z.minDate)),null!==te.get.maxDate()&&te.set.maxDate(o.data(Z.maxDate)),te.setting("type",te.get.type()),te.setting("on",L.on||(l.length?"focus":"click"))},popup:function(){var e,t,a;L.inline||(d.length||(d=o.children().first()).length)&&(ne.fn.popup!==re?(_.length||(a=0!==(t=d.parent()).closest(n.append).length?"appendTo":"prependTo",_=ne("<div/>").addClass($.popup)[a](t)),_.addClass($.calendar),ee&&_.addClass($.inverted),e=function(){return te.refreshTooltips(),L.onVisible.apply(_,arguments)},a=L.onHidden,l.length||(_.attr("tabindex","0"),e=function(){return te.refreshTooltips(),te.focus(),L.onVisible.apply(_,arguments)},a=function(){return te.blur(),L.onHidden.apply(_,arguments)}),t=te.setting("on"),a=ne.extend({},L.popupOptions,{popup:_,on:t,hoverable:"hover"===t,closable:"click"===t,onShow:function(){return te.set.focusDate(te.get.date()),te.set.mode(te.get.validatedMode(L.startMode)),L.onShow.apply(_,arguments)},onVisible:e,onHide:L.onHide,onHidden:a}),te.popup(a)):te.error(s.popup))},inline:function(){d.length&&!L.inline||(L.inline=!0,_=ne("<div/>").addClass($.calendar).appendTo(o),l.length||_.attr("tabindex","0"))},input:function(){L.touchReadonly&&l.length&&c&&l.prop("readonly",!0),te.check.disabled()},date:function(){var e;L.initialDate?e=a.date(L.initialDate,L):o.data(Z.date)!==re?e=a.date(o.data(Z.date),L):l.length&&(e=a.date(l.val(),L)),te.set.date(e,L.formatInput,!1),te.set.mode(te.get.mode(),!1)}},trigger:{change:function(){var e,t=l[0];t&&(e=k.createEvent("HTMLEvents"),te.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{calendar:function(){var e,t,a,n=te.get.mode(),r=new Date,i=te.get.date(),o=te.get.focusDate(),s=te.helper.dateInRange(o||i||L.initialDate||r);o||(o=s,te.set.focusDate(o,!1,!1));var l="year"===n,d="month"===n,u="day"===n,c="hour"===n,p="minute"===n,f="time"===L.type,m=Math.max(L.multiMonth,1),h=u?te.get.monthOffset():0,g=s.getMinutes(),D=s.getHours(),y=s.getDate(),v=s.getMonth()+h,b=s.getFullYear(),C=u?L.showWeekNumbers?8:7:c?4:X.column,w=u||c?6:X.row,M=u?m:1,x=_,T=x.hasClass("left")?"right center":"left center";for(x.empty(),1<M&&(a=ne("<div/>").addClass($.grid).appendTo(x)),t=0;t<M;t++){1<M&&(x=ne("<div/>").addClass($.column).appendTo(a));var k=v+t,O=(new Date(b,k,1).getDay()-L.firstDayOfWeek%7+7)%7;!L.constantHeight&&u&&(j=new Date(b,k+1,0).getDate()+O,w=Math.ceil(j/7));var F=l?10:d?1:0,N=u?1:0,A=c||p?1:0,E=c||p?y:1,H=new Date(b-F,k-N,E-A,D),Y=new Date(b+F,k+N,E+A,D),I=l?new Date(10*Math.ceil(b/10)-9,0,0):d?new Date(b,0,0):u?new Date(b,k,0):new Date(b,k,y,-1),j=l?new Date(10*Math.ceil(b/10)+1,0,1):d?new Date(b+1,0,1):u?new Date(b,k+1,1):new Date(b,k,y+1),F=n;u&&L.showWeekNumbers&&(F+=" andweek");N=ne("<table/>").addClass($.table).addClass(F).addClass(ae[C]+" column").appendTo(x);ee&&N.addClass($.inverted);var S=C;if(!f){var E=ne("<thead/>").appendTo(N),q=ne("<tr/>").appendTo(E),W=ne("<th/>").attr("colspan",""+C).appendTo(q),A=l||d?new Date(b,0,1):u?new Date(b,k,1):new Date(b,k,y,D,g),F=ne("<span/>").addClass($.link).appendTo(W);F.text(Q.header(A,n,L));var R,A=d?L.disableYear?"day":"year":u?L.disableMonth?"year":"month":"day";if(F.data(Z.mode,A),0===t&&((R=ne("<span/>").addClass($.prev).appendTo(W)).data(Z.focusDate,H),R.toggleClass($.disabledCell,!te.helper.isDateInRange(I,n)),ne("<i/>").addClass($.prevIcon).appendTo(R)),t===M-1&&((R=ne("<span/>").addClass($.next).appendTo(W)).data(Z.focusDate,Y),R.toggleClass($.disabledCell,!te.helper.isDateInRange(j,n)),ne("<i/>").addClass($.nextIcon).appendTo(R)),u)for(q=ne("<tr/>").appendTo(E),L.showWeekNumbers&&((W=ne("<th/>").appendTo(q)).text(L.text.weekNo),W.addClass($.weekCell),S--),G=0;G<S;G++)(W=ne("<th/>").appendTo(q)).text(Q.dayColumnHeader((G+L.firstDayOfWeek)%7,L))}for(var V=ne("<tbody/>").appendTo(N),G=l?10*Math.ceil(b/10)-9:u?1-O:0,P=0;P<w;P++)for(q=ne("<tr/>").appendTo(V),u&&L.showWeekNumbers&&((W=ne("<th/>").appendTo(q)).text(te.get.weekOfYear(b,k,G+1-L.firstDayOfWeek)),W.addClass($.weekCell)),e=0;e<S;e++,G++){var B=l?new Date(G,k,1,D,g):d?new Date(b,G,1,D,g):u?new Date(b,k,G,D,g):c?new Date(b,k,y,G):new Date(b,k,y,D,G*L.minTimeGap),K=l?G:d?L.text.monthsShort[G]:u?B.getDate():Q.time(B,L,!0);(W=ne("<td/>").addClass($.cell).appendTo(q)).text(K),W.data(Z.date,B);var U=u&&B.getMonth()!==(k+12)%12,K=!L.selectAdjacentDays&&U||!te.helper.isDateInRange(B,n)||L.isDisabled(B,n)||te.helper.isDisabled(B,n)||!te.helper.isEnabled(B,n);K?null!==(J=te.helper.findDayAsObject(B,n,L.disabledDates))&&J[Z.message]&&(W.attr("data-tooltip",J[Z.message]),W.attr("data-position",J[Z.position]||T),(J[Z.inverted]||ee&&J[Z.inverted]===re)&&W.attr("data-inverted",""),J[Z.variation]&&W.attr("data-variation",J[Z.variation])):null!==(z=te.helper.findDayAsObject(B,n,L.eventDates))&&(W.addClass(z[Z.class]||L.eventClass),z[Z.message]&&(W.attr("data-tooltip",z[Z.message]),W.attr("data-position",z[Z.position]||T),(z[Z.inverted]||ee&&z[Z.inverted]===re)&&W.attr("data-inverted",""),z[Z.variation]&&W.attr("data-variation",z[Z.variation])));var J=te.helper.dateEqual(B,i,n),z=te.helper.dateEqual(B,r,n);W.toggleClass($.adjacentCell,U),W.toggleClass($.disabledCell,K),W.toggleClass($.activeCell,J&&!U),c||p||W.toggleClass($.todayCell,!U&&z);z={mode:n,adjacent:U,disabled:K,active:J,today:z};Q.cell(W,B,z),te.helper.dateEqual(B,o,n)&&te.set.focusDate(B,!1,!1)}L.today&&(O=ne("<tr/>").appendTo(V),(O=ne("<td/>").attr("colspan",""+C).addClass($.today).appendTo(O)).text(Q.today(L)),O.data(Z.date,r)),te.update.focus(!1,N),L.inline&&te.refreshTooltips()}}},update:{focus:function(e,t){t=t||_;var o=te.get.mode(),a=te.get.date(),s=te.get.focusDate(),l=te.get.startDate(),d=te.get.endDate(),u=(e?s:null)||a||(c?null:s);t.find("td").each(function(){var e,t,a,n,r=ne(this),i=r.data(Z.date);i&&(e=r.hasClass($.disabledCell),t=r.hasClass($.activeCell),a=r.hasClass($.adjacentCell),n=te.helper.dateEqual(i,s,o),i=!!u&&(!!l&&te.helper.isDateInRange(i,o,l,u)||!!d&&te.helper.isDateInRange(i,o,u,d)),r.toggleClass($.focusCell,n&&(!c||f)&&(!a||L.selectAdjacentDays&&a)&&!e),te.helper.isTodayButton(r)||r.toggleClass($.rangeCell,i&&!t&&!e))})}},refresh:function(){te.create.calendar()},refreshTooltips:function(){var n=ne(T).width();_.find("td[data-position]").each(function(){var e=ne(this),t=T.getComputedStyle(e[0],":after").width.replace(/[^0-9\.]/g,""),a=e.attr("data-position"),t=n-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===a.indexOf(t)&&e.attr("data-position",a.replace(/(left|right)/,t))})},bind:{events:function(){te.debug("Binding events"),_.on("mousedown"+r,te.event.mousedown),_.on("touchstart"+r,te.event.mousedown),_.on("mouseup"+r,te.event.mouseup),_.on("touchend"+r,te.event.mouseup),_.on("mouseover"+r,te.event.mouseover),l.length?(l.on("input"+r,te.event.inputChange),l.on("focus"+r,te.event.inputFocus),l.on("blur"+r,te.event.inputBlur),l.on("keydown"+r,te.event.keydown)):_.on("keydown"+r,te.event.keydown)}},unbind:{events:function(){te.debug("Unbinding events"),_.off(r),l.length&&l.off(r)}},event:{mouseover:function(e){var t=ne(e.target).data(Z.date),e=1===e.buttons;t&&te.set.focusDate(t,!1,!0,e)},mousedown:function(e){l.length&&e.preventDefault(),f=0<=e.type.indexOf("touch");e=ne(e.target).data(Z.date);e&&te.set.focusDate(e,!1,!0,!0)},mouseup:function(e){te.focus(),e.preventDefault(),e.stopPropagation(),f=!1;var t,a,n=ne(e.target);n.hasClass("disabled")||(((a=n.parent()).data(Z.date)||a.data(Z.focusDate)||a.data(Z.mode))&&(n=a),t=n.data(Z.date),e=n.data(Z.focusDate),a=n.data(Z.mode),t&&!1!==L.onSelect.call(u,t,te.get.mode())?(n=n.hasClass($.today),te.selectDate(t,n)):e?te.set.focusDate(e):a&&te.set.mode(a))},keydown:function(e){var t,a,n,r,i,o,s,l=e.which;27!==l&&9!==l||te.popup("hide"),te.popup("is visible")&&(37===l||38===l||39===l||40===l?(i="day"===(o=te.get.mode())?7:"hour"===o?4:"minute"===o?X.column:3,s=37===l?-1:38===l?-i:39==l?1:i,s*="minute"===o?L.minTimeGap:1,a=(t=te.get.focusDate()||te.get.date()||new Date).getFullYear()+("year"===o?s:0),n=t.getMonth()+("month"===o?s:0),r=t.getDate()+("day"===o?s:0),i=t.getHours()+("hour"===o?s:0),s=t.getMinutes()+("minute"===o?s:0),s=new Date(a,n,r,i,s),"time"===L.type&&(s=te.helper.mergeDateTime(t,s)),te.helper.isDateInRange(s,o)&&te.set.focusDate(s)):13===l&&(o=te.get.mode(),(s=te.get.focusDate())&&!L.isDisabled(s,o)&&!te.helper.isDisabled(s,o)&&te.helper.isEnabled(s,o)&&te.selectDate(s),e.preventDefault(),e.stopPropagation())),38!==l&&40!==l||(e.preventDefault(),te.popup("show"))},inputChange:function(){var e=l.val(),e=a.date(e,L);te.set.date(e,!1)},inputFocus:function(){_.addClass($.active)},inputBlur:function(){var e;_.removeClass($.active),L.formatInput&&(e=te.get.date(),e=Q.datetime(e,L),l.val(e)),h&&(te.trigger.change(),h=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&te.check.disabled()})}}},observeChanges:function(){"MutationObserver"in T&&(e=new MutationObserver(te.event.class.mutation),te.debug("Setting up mutation observer",e),te.observe.class())},disconnect:{classObserver:function(){l.length&&e&&e.disconnect()}},observe:{class:function(){l.length&&e&&e.observe(o[0],{attributes:!0})}},is:{disabled:function(){return o.hasClass($.disabled)}},check:{disabled:function(){l.attr("tabindex",te.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,a){return t=Date.UTC(e,t,a+3)/864e5,a=Math.floor(t/7),t=new Date(6048e5*a).getUTCFullYear(),a-Math.floor(Date.UTC(t,0,7)/6048e5)+1},date:function(){return te.helper.sanitiseDate(o.data(Z.date))||null},inputDate:function(){return l.val()},focusDate:function(){return o.data(Z.focusDate)||null},startDate:function(){var e=te.get.calendarModule(L.startCalendar);return(e?e.get.date():o.data(Z.startDate))||null},endDate:function(){var e=te.get.calendarModule(L.endCalendar);return(e?e.get.date():o.data(Z.endDate))||null},minDate:function(){return o.data(Z.minDate)||null},maxDate:function(){return o.data(Z.maxDate)||null},monthOffset:function(){return o.data(Z.monthOffset)||0},mode:function(){var e=o.data(Z.mode)||L.startMode;return te.get.validatedMode(e)},validatedMode:function(e){var t=te.get.validModes();return 0<=ne.inArray(e,t)?e:"time"===L.type?"hour":"month"===L.type?"month":"year"===L.type?"year":"day"},type:function(){return o.data(Z.type)||L.type},validModes:function(){var e=[];return"time"!==L.type&&(L.disableYear&&"year"!==L.type||e.push("year"),(L.disableMonth||"year"===L.type)&&"month"!==L.type||e.push("month"),0<=L.type.indexOf("date")&&e.push("day")),0<=L.type.indexOf("time")&&(e.push("hour"),L.disableMinute||e.push("minute")),e},isTouch:function(){try{return k.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e instanceof ne||(e=ne(e).first()),e.data(i)):null}},set:{date:function(e,t,a){t=!1!==t,a=!1!==a,e=te.helper.sanitiseDate(e),e=te.helper.dateInRange(e);var n=te.get.mode(),r=Q.datetime(e,L);if(a&&!1===L.onBeforeChange.call(u,e,r,n))return!1;if(te.set.focusDate(e),L.isDisabled(e,n))return!1;var i=te.get.endDate();i&&e&&i<e&&te.set.endDate(re),te.set.dataKeyValue(Z.date,e),t&&l.length&&l.val(r),a&&L.onChange.call(u,e,r,n)},startDate:function(e,t){e=te.helper.sanitiseDate(e);var a=te.get.calendarModule(L.startCalendar);a&&a.set.date(e),te.set.dataKeyValue(Z.startDate,e,t)},endDate:function(e,t){e=te.helper.sanitiseDate(e);var a=te.get.calendarModule(L.endCalendar);a&&a.set.date(e),te.set.dataKeyValue(Z.endDate,e,t)},focusDate:function(e,t,a,n){e=te.helper.sanitiseDate(e),e=te.helper.dateInRange(e);var r="day"===te.get.mode(),i=te.get.focusDate();r&&e&&i&&((i=12*(e.getFullYear()-i.getFullYear())+e.getMonth()-i.getMonth())&&(i=te.get.monthOffset()-i,te.set.monthOffset(i,!1)));e=te.set.dataKeyValue(Z.focusDate,e,!!e&&t);a=!1!==a&&e&&!1===t||m!=n,m=n,a&&te.update.focus(n)},minDate:function(e){e=te.helper.sanitiseDate(e),null!==L.maxDate&&L.maxDate<=e?te.verbose("Unable to set minDate variable bigger that maxDate variable",e,L.maxDate):(te.setting("minDate",e),te.set.dataKeyValue(Z.minDate,e))},maxDate:function(e){e=te.helper.sanitiseDate(e),null!==L.minDate&&L.minDate>=e?te.verbose("Unable to set maxDate variable lower that minDate variable",e,L.minDate):(te.setting("maxDate",e),te.set.dataKeyValue(Z.maxDate,e))},monthOffset:function(e,t){var a=Math.max(L.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),te.set.dataKeyValue(Z.monthOffset,e,t)},mode:function(e,t){te.set.dataKeyValue(Z.mode,e,t)},dataKeyValue:function(e,t,a){var n=o.data(e),n=n===t||n<=t&&t<=n;return t?o.data(e,t):o.removeData(e),(a=!1!==a&&!n)&&te.refresh(),!n}},selectDate:function(e,t){te.verbose("New date selection",e);var a,n=te.get.mode();t||"minute"===n||L.disableMinute&&"hour"===n||"date"===L.type&&"day"===n||"month"===L.type&&"month"===n||"year"===L.type&&"year"===n?!1===te.set.date(e)||(h=!0,L.closable&&(te.popup("hide"),(a=te.get.calendarModule(L.endCalendar))&&("focus"!==a.setting("on")&&a.popup("show"),a.focus()))):(a="year"===n?L.disableMonth?"day":"month":"month"===n?"day":"day"===n?"hour":"minute",te.set.mode(a),"hour"===n||"day"===n&&te.get.date()?te.set.date(e,!0,!1):te.set.focusDate(e))},changeDate:function(e){te.set.date(e)},clear:function(){te.set.date(re)},popup:function(){return d.popup.apply(d,arguments)},focus:function(){(l.length?l:_).focus()},blur:function(){(l.length?l:_).blur()},helper:{isDisabled:function(a,n){return("day"===n||"month"===n||"year"===n)&&(-1!==L.disabledDaysOfWeek.indexOf(a.getDay())||L.disabledDates.some(function(e){if("string"==typeof e&&(e=te.helper.sanitiseDate(e)),e instanceof Date)return te.helper.dateEqual(a,e,n);if(null!==e&&"object"==typeof e){if(e[Z.year])return"number"==typeof e[Z.year]?a.getFullYear()==e[Z.year]:Array.isArray(e[Z.year])?-1<e[Z.year].indexOf(a.getFullYear()):void 0;if(e[Z.month]){if("number"==typeof e[Z.month])return a.getMonth()==e[Z.month];if(Array.isArray(e[Z.month]))return-1<e[Z.month].indexOf(a.getMonth());if(e[Z.month]instanceof Date){var t=te.helper.sanitiseDate(e[Z.month]);return a.getMonth()==t.getMonth()&&a.getFullYear()==t.getFullYear()}}else if(e[Z.date]&&"day"===n)return e[Z.date]instanceof Date?te.helper.dateEqual(a,te.helper.sanitiseDate(e[Z.date]),n):Array.isArray(e[Z.date])?e[Z.date].some(function(e){return te.helper.dateEqual(a,e,n)}):void 0}}))},isEnabled:function(t,a){return"day"!==a||(0===L.enabledDates.length||L.enabledDates.some(function(e){return"string"==typeof e&&(e=te.helper.sanitiseDate(e)),e instanceof Date?te.helper.dateEqual(t,e,a):null!==e&&"object"==typeof e&&e[Z.date]?te.helper.dateEqual(t,te.helper.sanitiseDate(e[Z.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=te.helper.sanitiseDate(n)),n instanceof Date&&te.helper.dateEqual(t,n,a)){var i={};return i[Z.date]=n,i}if(null!==n&&"object"==typeof n)if(n[Z.year]){if("number"==typeof n[Z.year]&&t.getFullYear()==n[Z.year])return n;if(Array.isArray(n[Z.year])&&-1<n[Z.year].indexOf(t.getFullYear()))return n}else if(n[Z.month]){if("number"==typeof n[Z.month]&&t.getMonth()==n[Z.month])return n;if(Array.isArray(n[Z.month])){if(-1<n[Z.month].indexOf(t.getMonth()))return n}else if(n[Z.month]instanceof Date){i=te.helper.sanitiseDate(n[Z.month]);if(t.getMonth()==i.getMonth()&&t.getFullYear()==i.getFullYear())return n}}else if(n[Z.date]&&"day"===a){if(n[Z.date]instanceof Date&&te.helper.dateEqual(t,te.helper.sanitiseDate(n[Z.date]),a))return n;if(Array.isArray(n[Z.date])&&n[Z.date].some(function(e){return te.helper.dateEqual(t,e,a)}))return n}}return null},sanitiseDate:function(e){return e?(e instanceof Date||(e=a.date(""+e,L)),!e||null===e||isNaN(e.getTime())?re:e):re},dateDiff:function(e,t,a){a=a||"day";var n="time"===L.type,r="year"===a,i=r||"month"===a,o="minute"===a,a=o||"hour"===a;return e=new Date(n?2e3:e.getFullYear(),n||r?0:e.getMonth(),n||i?1:e.getDate(),a?e.getHours():0,o?L.minTimeGap*Math.floor(e.getMinutes()/L.minTimeGap):0),(t=new Date(n?2e3:t.getFullYear(),n||r?0:t.getMonth(),n||i?1:t.getDate(),a?t.getHours():0,o?L.minTimeGap*Math.floor(t.getMinutes()/L.minTimeGap):0)).getTime()-e.getTime()},dateEqual:function(e,t,a){return!!e&&!!t&&0===te.helper.dateDiff(e,t,a)},isDateInRange:function(e,t,a,n){var r;return a||n||(a=(r=te.get.startDate())&&L.minDate?new Date(Math.max(r,L.minDate)):r||L.minDate,n=L.maxDate),a=a&&new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),L.minTimeGap*Math.ceil(a.getMinutes()/L.minTimeGap)),!(!e||a&&0<te.helper.dateDiff(e,a,t)||n&&0<te.helper.dateDiff(n,e,t))},dateInRange:function(e,t,a){t||a||(t=(n=te.get.startDate())&&L.minDate?new Date(Math.max(n,L.minDate)):n||L.minDate,a=L.maxDate),t=t&&new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),L.minTimeGap*Math.ceil(t.getMinutes()/L.minTimeGap));var n="time"===L.type;return e&&(t&&0<te.helper.dateDiff(e,t,"minute")?n?te.helper.mergeDateTime(e,t):t:a&&0<te.helper.dateDiff(a,e,"minute")?n?te.helper.mergeDateTime(e,a):a: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()===L.text.today}},setting:function(e,t){if(te.debug("Changing setting",e,t),ne.isPlainObject(e))ne.extend(!0,L,e);else{if(t===re)return L[e];ne.isPlainObject(L[e])?ne.extend(!0,L[e],t):L[e]=t}},internal:function(e,t){if(ne.isPlainObject(e))ne.extend(!0,te,e);else{if(t===re)return te[e];te[e]=t}},debug:function(){!L.silent&&L.debug&&(L.performance?te.performance.log(arguments):(te.debug=Function.prototype.bind.call(console.info,console,L.name+":"),te.debug.apply(console,arguments)))},verbose:function(){!L.silent&&L.verbose&&L.debug&&(L.performance?te.performance.log(arguments):(te.verbose=Function.prototype.bind.call(console.info,console,L.name+":"),te.verbose.apply(console,arguments)))},error:function(){L.silent||(te.error=Function.prototype.bind.call(console.error,console,L.name+":"),te.error.apply(console,arguments))},performance:{log:function(e){var t,a;L.performance&&(a=(t=(new Date).getTime())-(v||t),v=t,b.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:u,"Execution Time":a})),clearTimeout(te.performance.timer),te.performance.timer=setTimeout(te.performance.display,500)},display:function(){var e=L.name+":",a=0;v=!1,clearTimeout(te.performance.timer),ne.each(b,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",y&&(e+=" '"+y+"'"),(console.group!==re||console.table!==re)&&0<b.length&&(console.groupCollapsed(e),console.table?console.table(b):ne.each(b,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),b=[]}},invoke:function(n,e,t){var r,i,a,o=p;return e=e||M,t=u||t,"string"==typeof n&&o!==re&&(n=n.split(/[\. ]/),r=n.length-1,ne.each(n,function(e,t){var a=e!=r?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(ne.isPlainObject(o[a])&&e!=r)o=o[a];else{if(o[a]!==re)return i=o[a],!1;{if(!ne.isPlainObject(o[t])||e==r)return o[t]!==re?i=o[t]:te.error(s.method,n),!1;o=o[t]}}})),ne.isFunction(i)?a=i.apply(t,e):i!==re&&(a=i),Array.isArray(D)?D.push(a):D!==re?D=[D,a]:a!==re&&(D=a),i}};w?(p===re&&te.initialize(),te.invoke(C)):(p!==re&&p.invoke("destroy"),te.initialize())}),D!==re?D:this},ne.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){e=10*Math.ceil(e.getFullYear()/10);return e-9+" - "+(2+e)},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),e=t.type.indexOf("time")<0?"":t.formatter.time(e,t,!1);return a+("datetime"===t.type?" ":"")+e},date:function(e,t){if(!e)return"";var a=e.getDate(),n=t.text.months[e.getMonth()],e=e.getFullYear();return"year"===t.type?e:"month"===t.type?n+" "+e:(t.monthFirst?n+" "+a:a+" "+n)+", "+e},time:function(e,t,a){if(!e)return"";var n=e.getHours(),r=e.getMinutes(),e="";return t.ampm&&(e=" "+(n<12?t.text.am:t.text.pm),n=0===n?12:12<n?n-12:n),n+":"+(r<10?"0":"")+r+e},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=String(e).trim()).length)return null;e.match(/^[0-9]{4}[\/\-\.][0-9]{2}[\/\-\.][0-9]{2}$/)&&(e=e.replace(/[\/\-\.]/g,"/")+" 00:00:00"),e=t.monthFirst||!e.match(/^[0-9]{2}[\/\-\.]/)?e:e.replace(/[\/\-\.]/g,"/").replace(/([0-9]+)\/([0-9]+)/,"$2/$1");var a,n,r,i=new Date(e);if(!(null!==e.match(/^[0-9]+$/))&&!isNaN(i.getDate()))return i;e=e.toLowerCase();var o,s,l,d=-1,u=-1,c=-1,p=-1,f=-1,m=re,h="time"===t.type,i=t.type.indexOf("time")<0,g=e.split(t.regExp.dateWords),D=e.split(t.regExp.dateNumbers);if(!i)for(m=0<=ne.inArray(t.text.am.toLowerCase(),g)||!(0<=ne.inArray(t.text.pm.toLowerCase(),g))&&re,a=0;a<D.length;a++)if(0<=(s=D[a]).indexOf(":")){if(u<0||d<0)for(l=s.split(":"),r=0;r<Math.min(2,l.length);r++)n=parseInt(l[r]),isNaN(n)&&(n=0),0===r?u=n%24:d=n%60;D.splice(a,1)}if(!h){for(a=0;a<g.length;a++)if(!((o=g[a]).length<=0)){for(n=0;n<t.text.months.length;n++)if(t.text.months[n].substring(0,o.length).toLowerCase()===o){p=n+1;break}if(0<=p)break}for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&n>=t.centuryBreak&&a===D.length-1){n<=99&&(n+=t.currentCentury-100),f=n,D.splice(a,1);break}if(p<0)for(a=0;a<D.length;a++)if(r=1<a||t.monthFirst?a:1===a?0:1,n=parseInt(D[r]),!isNaN(n)&&1<=n&&n<=12){p=n,D.splice(r,1);break}for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&1<=n&&n<=31){c=n,D.splice(a,1);break}if(f<0)for(a=D.length-1;0<=a;a--)if(n=parseInt(D[a]),!isNaN(n)){n<=99&&(n+=t.currentCentury),f=n,D.splice(a,1);break}}if(!i){if(u<0)for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&0<=n&&n<=23){u=n,D.splice(a,1);break}if(d<0)for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&0<=n&&n<=59){d=n,D.splice(a,1);break}}if(d<0&&u<0&&c<0&&p<0&&f<0)return null;d<0&&(d=0),u<0&&(u=0),c<0&&(c=1),p<0&&(p=1),f<0&&(f=(new Date).getFullYear()),m!==re&&(m?12===u&&(u=0):u<12&&(u+=12));m=new Date(f,p-1,c,u,d);return m.getMonth()===p-1&&m.getFullYear()===f||(m=new Date(f,p,0,u,d)),isNaN(m.getTime())?null:m}},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",inverted:"inverted",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",disabled:"disabled"},metadata:{date:"date",focusDate:"focusDate",startDate:"startDate",endDate:"endDate",minDate:"minDate",maxDate:"maxDate",mode:"mode",type:"type",monthOffset:"monthOffset",message:"message",class:"class",inverted:"inverted",variation:"variation",position:"position",month:"month",year:"year"},eventClass:"blue"}}(jQuery,window,document);
\ No newline at end of file |