From b4dd6d710987a2b948bc9aca46fb8123694d891b Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Sat, 26 Oct 2013 20:01:28 +0200 Subject: [PATCH] Updated CHANGELOG Bumped Version number to 0.5.0 Rebuilt assets --- build/kalendae.js | 17 +++++++- build/kalendae.min.js | 39 ----------------- build/kalendae.standalone.js | 17 +++++++- build/kalendae.standalone.min.js | 74 -------------------------------- changelog.md | 12 +++++- src/header.js | 2 +- 6 files changed, 42 insertions(+), 119 deletions(-) delete mode 100644 build/kalendae.min.js delete mode 100644 build/kalendae.standalone.min.js diff --git a/build/kalendae.js b/build/kalendae.js index 2922028..1626241 100644 --- a/build/kalendae.js +++ b/build/kalendae.js @@ -2,7 +2,7 @@ * Kalendae, a framework agnostic javascript date picker * * Copyright(c) 2013 Jarvis Badgley (chipersoft@gmail.com) * * http://github.com/ChiperSoft/Kalendae * - * Version 0.4.2 * + * Version 0.5.0 * ********************************************************************/ (function (undefined) { @@ -692,6 +692,18 @@ var util = Kalendae.util = { } }, + fireEvent: function (elem, event) { + if (document.createEvent) { + var e = document.createEvent('HTMLEvents'); + e.initEvent(event, false, true); + elem.dispatchEvent(e); + } else if (document.createEventObject) { + elem.fireEvent('on' + event) ; + } else if (typeof elem['on' + event] == 'function' ) { + elem['on' + event](); + } + }, + hasClassName: function(elem, className) { //copied and modified from Prototype.js if (!(elem = util.$(elem))) return false; var eClassName = elem.className; @@ -900,6 +912,7 @@ Kalendae.Input = function (targetElement, options) { return; } $input.value = self.getSelected(); + util.fireEvent($input, 'change'); }); }; @@ -972,7 +985,7 @@ Kalendae.Input.prototype = util.merge(Kalendae.prototype, { util.removeEvent($input, 'keyup', this._events.inputKeyup); - $container.remove(); + $container.remove(); } }); diff --git a/build/kalendae.min.js b/build/kalendae.min.js deleted file mode 100644 index 943ca60..0000000 --- a/build/kalendae.min.js +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************** - * Kalendae, a framework agnostic javascript date picker * - * Copyright(c) 2013 Jarvis Badgley (chipersoft@gmail.com) * - * http://github.com/ChiperSoft/Kalendae * - * Version 0.4.2 * - ********************************************************************/ - -(function(y){var r,h,m=function(a,b){if("function"===typeof document.addEventListener||d.isIE8()){var c=!1;try{c=a instanceof Element}catch(k){c=!!a&&1===c.nodeType}c||"string"===typeof a||(b=a);var e=this,f=e.classes,g=e.settings=d.merge(e.defaults,{attachTo:a},b||{}),c=e.container=d.make("div",{"class":f.container}),m=e.calendars=[],p=h().day(g.weekStart),q,s=[],l,n,r,t;l=[];var v;n=0;q=g.months;d.isIE8()&&d.addClassName(c,"ie8");for(n=7;n--;)s.push(p.format(g.columnHeaderFormat)),p.add("days", -1);x(e);if("object"===typeof g.subscribe)for(n in g.subscribe)g.subscribe.hasOwnProperty(n)&&e.subscribe(n,g.subscribe[n]);e._sel=[];g.selected&&e.setSelected(g.selected,!1);q=g.viewStartDate?h(g.viewStartDate,g.format):0a||!e._sel)return!1;for(var c=w.length;c--;)if(w[c].startOf("day").yearDay()===a)return!0;return!1}}else e.blackout=function(){return!1};e.direction=e.directions[g.direction]?e.directions[g.direction]:e.directions.any;for(q=Math.max(g.months,1);q--;){l=d.make("div",{"class":f.calendar},c);l.setAttribute("data-cal-index", -q);1 -++n);r=d.make("div",{"class":f.days},l);n=0;l=[];do"week"==g.mode?(0===n%7&&(t=d.make("div",{"class":f.week+" clearfix"},r),l.push(t)),d.make("span",{},t)):l.push(d.make("span",{},r));while(42>++n);m.push({caption:p,days:l});q&&d.make("div",{"class":f.monthSeparator},c)}e.draw();d.addEvent(c,"mousedown",function(a,c){var b;if(d.hasClassName(c,f.nextMonth))e.disableNext||!1===e.publish("view-changed",e,["next-month"])||(e.viewStartDate.add("months",1),e.draw());else if(d.hasClassName(c,f.previousMonth))e.disablePreviousMonth|| -!1===e.publish("view-changed",e,["previous-month"])||(e.viewStartDate.subtract("months",1),e.draw());else if(d.hasClassName(c,f.nextYear))e.disableNext||!1===e.publish("view-changed",e,["next-year"])||(e.viewStartDate.add("years",1),e.draw());else if(d.hasClassName(c,f.previousYear))e.disablePreviousMonth||!1===e.publish("view-changed",e,["previous-year"])||(e.viewStartDate.subtract("years",1),e.draw());else if((d.hasClassName(c.parentNode,f.days)||d.hasClassName(c.parentNode,f.week))&&d.hasClassName(c, -f.dayActive)&&(b=c.getAttribute("data-date"))){if(b=h(b,g.dayAttributeFormat).hours(12),!1!==e.publish("date-clicked",e,[b]))switch(g.mode){case "multiple":e.addSelected(b)||e.removeSelected(b);break;case "range":e.addSelected(b);break;case "week":e.weekSelected(b);break;default:e.addSelected(b)}}else d.hasClassName(c.parentNode,f.week)&&(b=c.getAttribute("data-date"))&&(b=h(b,g.dayAttributeFormat).hours(12),!1!==e.publish("date-clicked",e,[b])&&"week"==g.mode&&e.weekSelected(b));return!1});(g.attachTo= -d.$(g.attachTo))&&g.attachTo.appendChild(c)}};m.prototype={defaults:{attachTo:null,months:1,weekStart:0,direction:"any",directionScrolling:!0,viewStartDate:null,blackout:null,selected:null,mode:"single",dayOutOfMonthClickable:!1,format:null,subscribe:null,columnHeaderFormat:"dd",titleFormat:"MMMM, YYYY",dayNumberFormat:"D",dayAttributeFormat:"YYYY-MM-DD",parseSplitDelimiter:/,\s*|\s+-\s+/,rangeDelimiter:" - ",multipleDelimiter:", ",useYearNav:!0,dateClassMap:{}},classes:{container:"kalendae",calendar:"k-calendar", -monthFirst:"k-first-month",monthMiddle:"k-middle-month",monthLast:"k-last-month",title:"k-title",previousMonth:"k-btn-previous-month",nextMonth:"k-btn-next-month",previousYear:"k-btn-previous-year",nextYear:"k-btn-next-year",caption:"k-caption",header:"k-header",days:"k-days",week:"k-week",dayOutOfMonth:"k-out-of-month",dayInMonth:"k-in-month",dayActive:"k-active",daySelected:"k-selected",dayInRange:"k-range",dayToday:"k-today",monthSeparator:"k-separator",disablePreviousMonth:"k-disable-previous-month-btn", -disableNextMonth:"k-disable-next-month-btn",disablePreviousYear:"k-disable-previous-year-btn",disableNextYear:"k-disable-next-year-btn",disableYearNav:"k-disable-year-nav"},disablePreviousMonth:!1,disableNextMonth:!1,disablePreviousYear:!1,disableNextYear:!1,directions:{past:function(a){return h(a).startOf("day").yearDay()>=r.yearDay()},"today-past":function(a){return h(a).startOf("day").yearDay()>r.yearDay()},any:function(a){return!1},"today-future":function(a){return h(a).startOf("day").yearDay()< -r.yearDay()},future:function(a){return h(a).startOf("day").yearDay()<=r.yearDay()}},getSelectedAsDates:function(){for(var a=[],b=0,c=this._sel.length;ba||!this._sel||1>this._sel.length)return!1;switch(this.settings.mode){case "week":case "range":var b=this._sel[0]?this._sel[0].startOf("day").yearDay():0,c=this._sel[1]?this._sel[1].startOf("day").yearDay():0;return b===a||c===a?1:b&&c?a>b&&a< -c||bc?-1:!1:0;case "multiple":for(b=this._sel.length;b--;)if(this._sel[b].startOf("day").yearDay()===a)return!0;return!1;default:return this._sel[0]&&this._sel[0].startOf("day").yearDay()===a}},setSelected:function(a,b){var c,d=u(a,this.settings.parseSplitDelimiter,this.settings.format),e=u(this.getSelected(),this.settings.parseSplitDelimiter,this.settings.format);for(c=e.length;c--;)this.removeSelected(e[c],!1);for(c=d.length;c--;)this.addSelected(d[c],!1);!1!==b&&(d[0]&&(this.viewStartDate= -h(d[0],this.settings.format)),this.draw())},addSelected:function(a,b){a=h(a,this.settings.format).hours(12);this.settings.dayOutOfMonthClickable&&"range"!==this.settings.mode&&this.makeSelectedDateVisible(a);switch(this.settings.mode){case "multiple":if(this.isSelected(a))return!1;this._sel.push(a);break;case "range":1!==this._sel.length?this._sel=[a]:a.startOf("day").yearDay()>this._sel[0].startOf("day").yearDay()?this._sel[1]=a:this._sel=[a,this._sel[0]];break;default:this._sel=[a]}this._sel.sort(function(a, -b){return a.startOf("day").yearDay()-b.startOf("day").yearDay()});this.publish("change",this,[a]);!1!==b&&this.draw();return!0},weekSelected:function(a){var b=a.toDate(),c=h(b).startOf("week"),b=h(b).endOf("week").subtract("day",1);this._sel=[c,b];this.publish("change",this,[a.day()]);this.draw()},makeSelectedDateVisible:function(a){outOfViewMonth=h(a).date("1").diff(this.viewStartDate,"months");0>outOfViewMonth?this.viewStartDate.subtract("months",1):0=this.settings.months&& -this.viewStartDate.add("months",1)},removeSelected:function(a,b){a=h(a,this.settings.format).hours(12);for(var c=this._sel.length;c--;)if(this._sel[c].startOf("day").yearDay()===a.startOf("day").yearDay())return this._sel.splice(c,1),this.publish("change",this,[a]),!1!==b&&this.draw(),!0;return!1},draw:function(){var a=h(this.viewStartDate).startOf("day").hours(12),b,c=this.classes,k,e,f,g=0,m,p=0,q,s,l=this.settings;m=this.calendars.length;do{b=h(a).date(1);b.day(b.day()++p);a.add("months",1)}while(++g=a?(this.disableNextMonth=!1,d.removeClassName(this.container,c.disableNextMonth)):(this.disableNextMonth= -!0,d.addClassName(this.container,c.disableNextMonth));else if("today-future"===l.direction||"future"===l.direction)a>l.months?(this.disablePreviousMonth=!1,d.removeClassName(this.container,c.disablePreviousMonth)):(this.disablePreviousMonth=!0,d.addClassName(this.container,c.disablePreviousMonth));if("today-past"===l.direction||"past"===l.direction)-11>=a?(this.disableNextYear=!1,d.removeClassName(this.container,c.disableNextYear)):(this.disableNextYear=!0,d.addClassName(this.container,c.disableNextYear)); -else if("today-future"===l.direction||"future"===l.direction)a>11+l.months?(this.disablePreviousYear=!1,d.removeClassName(this.container,c.disablePreviousYear)):(this.disablePreviousYear=!0,d.addClassName(this.container,c.disablePreviousYear))}}};var u=function(a,b,c){var k=[];"string"===typeof a?a=a.split(b):d.isArray(a)||(a=[a]);b=a.length;var e=0;do a[e]&&k.push(h(a[e],c).hours(12));while(++e element or a valid element id.";var g=this,h=g.classes;e=g.settings=d.merge(g.defaults,b);this._events={};e.attachTo=window.document.body;e.selected?k=!0:e.selected=c.value; -m.call(g,e);e.closeButton&&(e=d.make("a",{"class":h.closeButton},g.container),d.addEvent(e,"click",function(){c.blur()}));k&&(c.value=g.getSelected());k=g.container;var p=!1;k.style.display="none";d.addClassName(k,h.positioned);this._events.containerMouseDown=d.addEvent(k,"mousedown",function(a,c){p=!0});this._events.documentMousedown=d.addEvent(window.document,"mousedown",function(a,c){p=!1});this._events.inputFocus=d.addEvent(c,"focus",function(){f=!0;g.setSelected(this.value);f=!1;g.show()});this._events.inputBlur= -d.addEvent(c,"blur",function(){p&&d.isIE8()?(p=!1,c.focus()):g.hide()});this._events.inputKeyup=d.addEvent(c,"keyup",function(a){f=!0;g.setSelected(this.value);f=!1});(h=d.scrollContainer(c))&&d.addEvent(h,"scroll",function(a){c.blur()});g.subscribe("change",function(){f||(c.value=g.getSelected())})}};m.Input.prototype=d.merge(m.prototype,{defaults:d.merge(m.prototype.defaults,{format:"MM/DD/YYYY",side:"bottom",closeButton:!0,offsetLeft:0,offsetTop:0}),classes:d.merge(m.prototype.classes,{positioned:"k-floating", -closeButton:"k-btn-close"}),show:function(){var a=this.container,b=a.style,c=this.input,k=d.getPosition(c),e=d.scrollContainer(c),e=e?e.scrollTop:0,f=this.settings;b.display="";switch(f.side){case "left":b.left=k.left-d.getWidth(a)+f.offsetLeft+"px";b.top=k.top+f.offsetTop-e+"px";break;case "right":b.left=k.left+d.getWidth(c)+"px";b.top=k.top+f.offsetTop-e+"px";break;case "top":b.left=k.left+f.offsetLeft+"px";b.top=k.top-d.getHeight(a)+f.offsetTop-e+"px";break;default:b.left=k.left+f.offsetLeft+"px", -b.top=k.top+d.getHeight(c)+f.offsetTop-e+"px"}b.position=d.isFixed(c)?"fixed":"absolute";this.publish("show",this)},hide:function(){this.container.style.display="none";this.publish("hide",this)},destroy:function(){var a=this.input;d.removeEvent(this.container,"mousedown",this._events.containerMousedown);d.removeEvent(window.document,"mousedown",this._events.documentMousedown);d.removeEvent(a,"focus",this._events.inputFocus);d.removeEvent(a,"blur",this._events.inputBlur);d.removeEvent(a,"keyup",this._events.inputKeyup)}}); -var x=function(a){a||(a=this);var b=a.c_||{};a.publish=function(a,d,e){for(var f=(a=b[a])?a.length:0,g;f--;)if(g=a[f].apply(d,e||[]),"boolean"===typeof g)return g};a.subscribe=function(a,d,e){b[a]||(b[a]=[]);e?b[a].push(d):b[a].unshift(d);return[a,d]};a.unsubscribe=function(a){var d=b[a[0]];a=a[1];for(var e=d?d.length:0;e--;)d[e]===a&&d.splice(e,1)}};if(!m.moment)if(window.moment)m.moment=window.moment;else throw"Kalendae requires moment.js. You must use kalendae.standalone.js if moment is not available on the page."; -h=m.moment;h.fn.yearDay=function(a){var b=Math.floor(this._d/864E5);return"undefined"===typeof a?b:this.add({d:a-b})};r=m.moment().startOf("day");"undefined"===typeof jQuery||"function"!==typeof document.addEventListener&&!d.isIE8()||(jQuery.fn.kalendae=function(a){this.each(function(b,c){"INPUT"===c.tagName?$(c).data("kalendae",new m.Input(c,a)):$(c).data("kalendae",new m($.extend({},{attachTo:c},a)))});return this})})(); diff --git a/build/kalendae.standalone.js b/build/kalendae.standalone.js index a5c0b1a..ae4cb8b 100644 --- a/build/kalendae.standalone.js +++ b/build/kalendae.standalone.js @@ -2,7 +2,7 @@ * Kalendae, a framework agnostic javascript date picker * * Copyright(c) 2013 Jarvis Badgley (chipersoft@gmail.com) * * http://github.com/ChiperSoft/Kalendae * - * Version 0.4.2 * + * Version 0.5.0 * ********************************************************************/ (function (undefined) { @@ -692,6 +692,18 @@ var util = Kalendae.util = { } }, + fireEvent: function (elem, event) { + if (document.createEvent) { + var e = document.createEvent('HTMLEvents'); + e.initEvent(event, false, true); + elem.dispatchEvent(e); + } else if (document.createEventObject) { + elem.fireEvent('on' + event) ; + } else if (typeof elem['on' + event] == 'function' ) { + elem['on' + event](); + } + }, + hasClassName: function(elem, className) { //copied and modified from Prototype.js if (!(elem = util.$(elem))) return false; var eClassName = elem.className; @@ -900,6 +912,7 @@ Kalendae.Input = function (targetElement, options) { return; } $input.value = self.getSelected(); + util.fireEvent($input, 'change'); }); }; @@ -972,7 +985,7 @@ Kalendae.Input.prototype = util.merge(Kalendae.prototype, { util.removeEvent($input, 'keyup', this._events.inputKeyup); - $container.remove(); + $container.remove(); } }); diff --git a/build/kalendae.standalone.min.js b/build/kalendae.standalone.min.js deleted file mode 100644 index 7aa1297..0000000 --- a/build/kalendae.standalone.min.js +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************** - * Kalendae, a framework agnostic javascript date picker * - * Copyright(c) 2013 Jarvis Badgley (chipersoft@gmail.com) * - * http://github.com/ChiperSoft/Kalendae * - * Version 0.4.2 * - ********************************************************************/ - -(function(ja){var w,m,s=function(a,b){if("function"===typeof document.addEventListener||d.isIE8()){var e=!1;try{e=a instanceof Element}catch(p){e=!!a&&1===e.nodeType}e||"string"===typeof a||(b=a);var f=this,h=f.classes,k=f.settings=d.merge(f.defaults,{attachTo:a},b||{}),e=f.container=d.make("div",{"class":h.container}),s=f.calendars=[],q=m().day(k.weekStart),u,v=[],n,r,B,w;n=[];var D;r=0;u=k.months;d.isIE8()&&d.addClassName(e,"ie8");for(r=7;r--;)v.push(q.format(k.columnHeaderFormat)),q.add("days", -1);F(f);if("object"===typeof k.subscribe)for(r in k.subscribe)k.subscribe.hasOwnProperty(r)&&f.subscribe(r,k.subscribe[r]);f._sel=[];k.selected&&f.setSelected(k.selected,!1);u=k.viewStartDate?m(k.viewStartDate,k.format):0a||!f._sel)return!1;for(var e=C.length;e--;)if(C[e].startOf("day").yearDay()===a)return!0;return!1}}else f.blackout=function(){return!1};f.direction=f.directions[k.direction]?f.directions[k.direction]:f.directions.any;for(u=Math.max(k.months,1);u--;){n=d.make("div",{"class":h.calendar},e);n.setAttribute("data-cal-index", -u);1 -++r);B=d.make("div",{"class":h.days},n);r=0;n=[];do"week"==k.mode?(0===r%7&&(w=d.make("div",{"class":h.week+" clearfix"},B),n.push(w)),d.make("span",{},w)):n.push(d.make("span",{},B));while(42>++r);s.push({caption:q,days:n});u&&d.make("div",{"class":h.monthSeparator},e)}f.draw();d.addEvent(e,"mousedown",function(a,e){var b;if(d.hasClassName(e,h.nextMonth))f.disableNext||!1===f.publish("view-changed",f,["next-month"])||(f.viewStartDate.add("months",1),f.draw());else if(d.hasClassName(e,h.previousMonth))f.disablePreviousMonth|| -!1===f.publish("view-changed",f,["previous-month"])||(f.viewStartDate.subtract("months",1),f.draw());else if(d.hasClassName(e,h.nextYear))f.disableNext||!1===f.publish("view-changed",f,["next-year"])||(f.viewStartDate.add("years",1),f.draw());else if(d.hasClassName(e,h.previousYear))f.disablePreviousMonth||!1===f.publish("view-changed",f,["previous-year"])||(f.viewStartDate.subtract("years",1),f.draw());else if((d.hasClassName(e.parentNode,h.days)||d.hasClassName(e.parentNode,h.week))&&d.hasClassName(e, -h.dayActive)&&(b=e.getAttribute("data-date"))){if(b=m(b,k.dayAttributeFormat).hours(12),!1!==f.publish("date-clicked",f,[b]))switch(k.mode){case "multiple":f.addSelected(b)||f.removeSelected(b);break;case "range":f.addSelected(b);break;case "week":f.weekSelected(b);break;default:f.addSelected(b)}}else d.hasClassName(e.parentNode,h.week)&&(b=e.getAttribute("data-date"))&&(b=m(b,k.dayAttributeFormat).hours(12),!1!==f.publish("date-clicked",f,[b])&&"week"==k.mode&&f.weekSelected(b));return!1});(k.attachTo= -d.$(k.attachTo))&&k.attachTo.appendChild(e)}};s.prototype={defaults:{attachTo:null,months:1,weekStart:0,direction:"any",directionScrolling:!0,viewStartDate:null,blackout:null,selected:null,mode:"single",dayOutOfMonthClickable:!1,format:null,subscribe:null,columnHeaderFormat:"dd",titleFormat:"MMMM, YYYY",dayNumberFormat:"D",dayAttributeFormat:"YYYY-MM-DD",parseSplitDelimiter:/,\s*|\s+-\s+/,rangeDelimiter:" - ",multipleDelimiter:", ",useYearNav:!0,dateClassMap:{}},classes:{container:"kalendae",calendar:"k-calendar", -monthFirst:"k-first-month",monthMiddle:"k-middle-month",monthLast:"k-last-month",title:"k-title",previousMonth:"k-btn-previous-month",nextMonth:"k-btn-next-month",previousYear:"k-btn-previous-year",nextYear:"k-btn-next-year",caption:"k-caption",header:"k-header",days:"k-days",week:"k-week",dayOutOfMonth:"k-out-of-month",dayInMonth:"k-in-month",dayActive:"k-active",daySelected:"k-selected",dayInRange:"k-range",dayToday:"k-today",monthSeparator:"k-separator",disablePreviousMonth:"k-disable-previous-month-btn", -disableNextMonth:"k-disable-next-month-btn",disablePreviousYear:"k-disable-previous-year-btn",disableNextYear:"k-disable-next-year-btn",disableYearNav:"k-disable-year-nav"},disablePreviousMonth:!1,disableNextMonth:!1,disablePreviousYear:!1,disableNextYear:!1,directions:{past:function(a){return m(a).startOf("day").yearDay()>=w.yearDay()},"today-past":function(a){return m(a).startOf("day").yearDay()>w.yearDay()},any:function(a){return!1},"today-future":function(a){return m(a).startOf("day").yearDay()< -w.yearDay()},future:function(a){return m(a).startOf("day").yearDay()<=w.yearDay()}},getSelectedAsDates:function(){for(var a=[],b=0,e=this._sel.length;ba||!this._sel||1>this._sel.length)return!1;switch(this.settings.mode){case "week":case "range":var b=this._sel[0]?this._sel[0].startOf("day").yearDay():0,e=this._sel[1]?this._sel[1].startOf("day").yearDay():0;return b===a||e===a?1:b&&e?a>b&&a< -e||be?-1:!1:0;case "multiple":for(b=this._sel.length;b--;)if(this._sel[b].startOf("day").yearDay()===a)return!0;return!1;default:return this._sel[0]&&this._sel[0].startOf("day").yearDay()===a}},setSelected:function(a,b){var e,d=z(a,this.settings.parseSplitDelimiter,this.settings.format),f=z(this.getSelected(),this.settings.parseSplitDelimiter,this.settings.format);for(e=f.length;e--;)this.removeSelected(f[e],!1);for(e=d.length;e--;)this.addSelected(d[e],!1);!1!==b&&(d[0]&&(this.viewStartDate= -m(d[0],this.settings.format)),this.draw())},addSelected:function(a,b){a=m(a,this.settings.format).hours(12);this.settings.dayOutOfMonthClickable&&"range"!==this.settings.mode&&this.makeSelectedDateVisible(a);switch(this.settings.mode){case "multiple":if(this.isSelected(a))return!1;this._sel.push(a);break;case "range":1!==this._sel.length?this._sel=[a]:a.startOf("day").yearDay()>this._sel[0].startOf("day").yearDay()?this._sel[1]=a:this._sel=[a,this._sel[0]];break;default:this._sel=[a]}this._sel.sort(function(a, -b){return a.startOf("day").yearDay()-b.startOf("day").yearDay()});this.publish("change",this,[a]);!1!==b&&this.draw();return!0},weekSelected:function(a){var b=a.toDate(),e=m(b).startOf("week"),b=m(b).endOf("week").subtract("day",1);this._sel=[e,b];this.publish("change",this,[a.day()]);this.draw()},makeSelectedDateVisible:function(a){outOfViewMonth=m(a).date("1").diff(this.viewStartDate,"months");0>outOfViewMonth?this.viewStartDate.subtract("months",1):0=this.settings.months&& -this.viewStartDate.add("months",1)},removeSelected:function(a,b){a=m(a,this.settings.format).hours(12);for(var e=this._sel.length;e--;)if(this._sel[e].startOf("day").yearDay()===a.startOf("day").yearDay())return this._sel.splice(e,1),this.publish("change",this,[a]),!1!==b&&this.draw(),!0;return!1},draw:function(){var a=m(this.viewStartDate).startOf("day").hours(12),b,e=this.classes,p,f,h,k=0,s,q=0,u,v,n=this.settings;s=this.calendars.length;do{b=m(a).date(1);b.day(b.day()++q);a.add("months",1)}while(++k=a?(this.disableNextMonth=!1,d.removeClassName(this.container,e.disableNextMonth)):(this.disableNextMonth= -!0,d.addClassName(this.container,e.disableNextMonth));else if("today-future"===n.direction||"future"===n.direction)a>n.months?(this.disablePreviousMonth=!1,d.removeClassName(this.container,e.disablePreviousMonth)):(this.disablePreviousMonth=!0,d.addClassName(this.container,e.disablePreviousMonth));if("today-past"===n.direction||"past"===n.direction)-11>=a?(this.disableNextYear=!1,d.removeClassName(this.container,e.disableNextYear)):(this.disableNextYear=!0,d.addClassName(this.container,e.disableNextYear)); -else if("today-future"===n.direction||"future"===n.direction)a>11+n.months?(this.disablePreviousYear=!1,d.removeClassName(this.container,e.disablePreviousYear)):(this.disablePreviousYear=!0,d.addClassName(this.container,e.disablePreviousYear))}}};var z=function(a,b,e){var p=[];"string"===typeof a?a=a.split(b):d.isArray(a)||(a=[a]);b=a.length;var f=0;do a[f]&&p.push(m(a[f],e).hours(12));while(++f element or a valid element id.";var k=this,m=k.classes;f=k.settings=d.merge(k.defaults,b);this._events={};f.attachTo=window.document.body;f.selected?p=!0:f.selected=e.value; -s.call(k,f);f.closeButton&&(f=d.make("a",{"class":m.closeButton},k.container),d.addEvent(f,"click",function(){e.blur()}));p&&(e.value=k.getSelected());p=k.container;var q=!1;p.style.display="none";d.addClassName(p,m.positioned);this._events.containerMouseDown=d.addEvent(p,"mousedown",function(a,e){q=!0});this._events.documentMousedown=d.addEvent(window.document,"mousedown",function(a,e){q=!1});this._events.inputFocus=d.addEvent(e,"focus",function(){h=!0;k.setSelected(this.value);h=!1;k.show()});this._events.inputBlur= -d.addEvent(e,"blur",function(){q&&d.isIE8()?(q=!1,e.focus()):k.hide()});this._events.inputKeyup=d.addEvent(e,"keyup",function(a){h=!0;k.setSelected(this.value);h=!1});(m=d.scrollContainer(e))&&d.addEvent(m,"scroll",function(a){e.blur()});k.subscribe("change",function(){h||(e.value=k.getSelected())})}};s.Input.prototype=d.merge(s.prototype,{defaults:d.merge(s.prototype.defaults,{format:"MM/DD/YYYY",side:"bottom",closeButton:!0,offsetLeft:0,offsetTop:0}),classes:d.merge(s.prototype.classes,{positioned:"k-floating", -closeButton:"k-btn-close"}),show:function(){var a=this.container,b=a.style,e=this.input,p=d.getPosition(e),f=d.scrollContainer(e),f=f?f.scrollTop:0,h=this.settings;b.display="";switch(h.side){case "left":b.left=p.left-d.getWidth(a)+h.offsetLeft+"px";b.top=p.top+h.offsetTop-f+"px";break;case "right":b.left=p.left+d.getWidth(e)+"px";b.top=p.top+h.offsetTop-f+"px";break;case "top":b.left=p.left+h.offsetLeft+"px";b.top=p.top-d.getHeight(a)+h.offsetTop-f+"px";break;default:b.left=p.left+h.offsetLeft+"px", -b.top=p.top+d.getHeight(e)+h.offsetTop-f+"px"}b.position=d.isFixed(e)?"fixed":"absolute";this.publish("show",this)},hide:function(){this.container.style.display="none";this.publish("hide",this)},destroy:function(){var a=this.input;d.removeEvent(this.container,"mousedown",this._events.containerMousedown);d.removeEvent(window.document,"mousedown",this._events.documentMousedown);d.removeEvent(a,"focus",this._events.inputFocus);d.removeEvent(a,"blur",this._events.inputBlur);d.removeEvent(a,"keyup",this._events.inputKeyup)}}); -var F=function(a){a||(a=this);var b=a.c_||{};a.publish=function(a,d,f){for(var h=(a=b[a])?a.length:0,k;h--;)if(k=a[h].apply(d,f||[]),"boolean"===typeof k)return k};a.subscribe=function(a,d,f){b[a]||(b[a]=[]);f?b[a].push(d):b[a].unshift(d);return[a,d]};a.unsubscribe=function(a){var d=b[a[0]];a=a[1];for(var f=d?d.length:0;f--;)d[f]===a&&d.splice(f,1)}};(function(a){function b(c,l){return function(a){return q(c.call(this,a),l)}}function e(c,l){return function(a){return this.lang().ordinal(c.call(this, -a),l)}}function d(){}function f(c){k(this,c)}function h(c){var l=c.years||c.year||c.y||0,a=c.months||c.month||c.M||0,b=c.weeks||c.week||c.w||0,e=c.days||c.day||c.d||0,d=c.hours||c.hour||c.h||0,f=c.minutes||c.minute||c.m||0,g=c.seconds||c.second||c.s||0,h=c.milliseconds||c.millisecond||c.ms||0;this._input=c;this._milliseconds=h+1E3*g+6E4*f+36E5*d;this._days=e+7*b;this._months=a+12*l;this._data={};this._bubble()}function k(c,l){for(var a in l)l.hasOwnProperty(a)&&(c[a]=l[a]);return c}function m(c){return 0> -c?Math.ceil(c):Math.floor(c)}function q(c,l){for(var a=c+"";a.lengtha;a++)c._a[a]=b[a]=null==c._a[a]?2===a?1:0:c._a[a];b[3]+=~~((c._tzm||0)/60);b[4]+=~~((c._tzm||0)%60);a=new Date(0);c._useUTC?(a.setUTCFullYear(b[0],b[1],b[2]),a.setUTCHours(b[3],b[4],b[5],b[6])):(a.setFullYear(b[0],b[1],b[2]),a.setHours(b[3],b[4],b[5],b[6]));c._d=a}}function G(c){var a=c._f.match(N),b=c._i,e,d;c._a=[];for(e=0;ec._a[3]&&(c._a[3]+=12);!1===c._isPm&&12===c._a[3]&&(c._a[3]=0);L(c)}function F(c,a,b,d,e){return e.relativeTime(a||1,!!b,c,d)}function E(c,a,b){a=b-a;b-=c.day();b>a&&(b-=7);bb;b++)if(Q[b][1].exec(l)){e._f+=Q[b][0];break}I.exec(l)&&(e._f+=" Z");G(e)}else e._d=new Date(l);else"[object Array]"===Object.prototype.toString.call(l)?(e._a=l.slice(0),L(e)):e._d=l instanceof Date?new Date(+l):new Date(l);return new f(c)}function R(c,a){g.fn[c]=g.fn[c+"s"]=function(c){var b=this._isUTC?"UTC":"";return null!=c?(this._d["set"+b+a](c),g.updateOffset(this),this):this._d["get"+b+a]()}}function ha(c){g.duration.fn[c]=function(){return this._data[c]}} -function S(c,a){g.duration.fn["as"+c]=function(){return+this/a}}for(var g,y=Math.round,t,A={},M="undefined"!==typeof module&&module.exports,fa=/^\/?Date\((\-?\d+)/i,ia=/(\-)?(\d*)?\.?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/,N=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,O=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,da=/\d\d?/,Z=/\d{1,3}/,W=/\d{3}/,X=/\d{1,4}/,Y=/[+\-]?\d{1,6}/,aa=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, -I=/Z|[\+\-]\d\d:?\d\d/i,ca=/T/i,ba=/[\+\-]?\d+(\.\d{1,3})?/,ga=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,Q=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],ea=/([\+\-]|\d\d)/gi,J=["Date","Hours","Minutes","Seconds","Milliseconds"],K={Milliseconds:1,Seconds:1E3,Minutes:6E4,Hours:36E5,Days:864E5,Months:2592E6,Years:31536E6},V={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day", -w:"week",M:"month",y:"year"},H={},T="DDD w W M D d".split(" "),U="MDHhmswW".split(""),x={M:function(){return this.month()+1},MMM:function(c){return this.lang().monthsShort(this,c)},MMMM:function(c){return this.lang().months(this,c)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(c){return this.lang().weekdaysMin(this,c)},ddd:function(c){return this.lang().weekdaysShort(this,c)},dddd:function(c){return this.lang().weekdays(this, -c)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return q(this.year()%100,2)},YYYY:function(){return q(this.year(),4)},YYYYY:function(){return q(this.year(),5)},gg:function(){return q(this.weekYear()%100,2)},gggg:function(){return this.weekYear()},ggggg:function(){return q(this.weekYear(),5)},GG:function(){return q(this.isoWeekYear()%100,2)},GGGG:function(){return this.isoWeekYear()},GGGGG:function(){return q(this.isoWeekYear(),5)},e:function(){return this.weekday()}, -E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return q(~~(this.milliseconds()/10),2)},SSS:function(){return q(this.milliseconds(),3)},Z:function(){var c= --this.zone(),a="+";0>c&&(c=-c,a="-");return a+q(~~(c/60),2)+":"+q(~~c%60,2)},ZZ:function(){var c=-this.zone(),a="+";0>c&&(c=-c,a="-");return a+q(~~(10*c/6),4)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()}};T.length;)t=T.pop(),x[t+"o"]=e(x[t],t);for(;U.length;)t=U.pop(),x[t+t]=b(x[t],2);x.DDDD=b(x.DDD,3);d.prototype={set:function(c){var a,b;for(b in c)a=c[b],"function"===typeof a?this[b]=a:this["_"+b]=a},_months:"January February March April May June July August September October November December".split(" "), -months:function(c){return this._months[c.month()]},_monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),monthsShort:function(c){return this._monthsShort[c.month()]},monthsParse:function(c){var a,b;this._monthsParse||(this._monthsParse=[]);for(a=0;12>a;a++)if(this._monthsParse[a]||(b=g([2E3,a]),b="^"+this.months(b,"")+"|^"+this.monthsShort(b,""),this._monthsParse[a]=RegExp(b.replace(".",""),"i")),this._monthsParse[a].test(c))return a},_weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), -weekdays:function(c){return this._weekdays[c.day()]},_weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysShort:function(c){return this._weekdaysShort[c.day()]},_weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),weekdaysMin:function(c){return this._weekdaysMin[c.day()]},weekdaysParse:function(c){var a,b;this._weekdaysParse||(this._weekdaysParse=[]);for(a=0;7>a;a++)if(this._weekdaysParse[a]||(b=g([2E3,1]).day(a),b="^"+this.weekdays(b,"")+"|^"+this.weekdaysShort(b,"")+"|^"+this.weekdaysMin(b, -""),this._weekdaysParse[a]=RegExp(b.replace(".",""),"i")),this._weekdaysParse[a].test(c))return a},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(c){var a=this._longDateFormat[c];!a&&this._longDateFormat[c.toUpperCase()]&&(a=this._longDateFormat[c.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(c){return c.slice(1)}),this._longDateFormat[c]=a);return a},isPM:function(c){return"p"===(c+"").toLowerCase()[0]}, -_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(c,a,b){return 11c?"sameElse":-1>c?"lastWeek":0>c?"lastDay":1>c?"sameDay":2>c?"nextDay":7>c?"nextWeek":"sameElse";return this.format(this.lang().calendar(c,this))},isLeapYear:function(){var c=this.year();return 0===c%4&&0!==c%100||0===c%400},isDST:function(){return this.zone()+g(a).startOf(b)},isBefore:function(a,b){b="undefined"!==typeof b?b:"millisecond";return+this.clone().startOf(b)<+g(a).startOf(b)},isSame:function(a,b){b="undefined"!==typeof b?b:"millisecond";return+this.clone().startOf(b)===+g(a).startOf(b)}, -min:function(a){a=g.apply(null,arguments);return athis?this:a},zone:function(a){var b=this._offset||0;if(null!=a)"string"===typeof a&&(a=C(a)),16>Math.abs(a)&&(a*=60),this._offset=a,this._isUTC=!0,b!==a&&s(this,g.duration(b-a,"m"),1,!0);else return this._isUTC?b:this._d.getTimezoneOffset();return this},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},daysInMonth:function(){return g.utc([this.year(), -this.month()+1,0]).date()},dayOfYear:function(a){var b=y((g(this).startOf("day")-g(this).startOf("year"))/864E5)+1;return null==a?b:this.add("d",a-b)},weekYear:function(a){var b=E(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=E(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=E(this,1,4).week;return null==a?b:this.add("d", -7*(a-b))},weekday:function(a){var b=(this._d.getDay()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},lang:function(c){if(c===a)return this._lang;this._lang=r(c);return this}};for(t=0;tf&&["s",f]||1===g&&["m"]||45>g&&["mm",g]||1===h&&["h"]||22>h&&["hh",h]||1===k&&["d"]||25>=k&&["dd",k]||45>=k&&["M"]||345>k&&["MM",y(k/30)]||1===m&&["y"]||["yy",m];f[2]=d;f[3]=0