Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated combined and minified, incremented version number to 0.2

  • Loading branch information...
commit 9d29ff5de01d68a1683722ebec2ebfa0910aabe5 1 parent 6f144a9
@ChiperSoft ChiperSoft authored
Showing with 62 additions and 45 deletions.
  1. +19 −3 build/kalendae.js
  2. +42 −41 build/kalendae.min.js
  3. +1 −1  src/header.js
View
22 build/kalendae.js
@@ -2,7 +2,7 @@
* Kalendae, a framework agnostic javascript date picker *
* Copyright(c) 2012 Jarvis Badgley (chipersoft@gmail.com) *
* http://github.com/ChiperSoft/Kalendae *
- * Version 0.1 *
+ * Version 0.2 *
********************************************************************/
(function (undefined) {
@@ -30,6 +30,8 @@ var Kalendae = function (targetElement, options) {
i = 0,
j = opts.months;
+ if (util.isIE8()) util.addClassName($container, 'ie8');
+
//generate the column headers (Su, Mo, Tu, etc)
i = 7;
while (i--) {
@@ -520,6 +522,11 @@ var parseDates = function (input, delimiter, format) {
window.Kalendae = Kalendae;
var util = Kalendae.util = {
+
+ isIE8: function() {
+ return !!( (/msie 8./i).test(navigator.appVersion) && !(/opera/i).test(navigator.userAgent) && window.ActiveXObject && XDomainRequest && !window.msPerformance );
+ },
+
// ELEMENT FUNCTIONS
$: function (elem) {
@@ -726,6 +733,14 @@ Kalendae.Input = function (targetElement, options) {
//call our parent constructor
Kalendae.call(self, opts);
+ //create the close button
+ if (opts.closeButton) {
+ var $closeButton = util.make('a', {'class':classes.closeButton}, self.container)
+ util.addEvent($closeButton, 'click', function () {
+ $input.blur();
+ });
+ }
+
if (overwriteInput) $input.value = self.getSelected();
var $container = self.container,
@@ -767,12 +782,13 @@ Kalendae.Input.prototype = util.merge(Kalendae.prototype, {
defaults : util.merge(Kalendae.prototype.defaults, {
format: 'MM/DD/YYYY',
side: 'bottom',
+ closeButton: true,
offsetLeft: 0,
offsetTop: 0
}),
classes : util.merge(Kalendae.prototype.classes, {
- positioned : 'k-floating'
-
+ positioned : 'k-floating',
+ closeButton: 'k-btn-close'
}),
show : function () {
View
83 build/kalendae.min.js
@@ -2,46 +2,47 @@
* Kalendae, a framework agnostic javascript date picker *
* Copyright(c) 2012 Jarvis Badgley (chipersoft@gmail.com) *
* http://github.com/ChiperSoft/Kalendae *
- * Version 0.1 *
+ * Version 0.2 *
********************************************************************/
-(function(){var l,j=function(a,c){a instanceof Element||"string"===typeof a||(c=a);var b=this,d=b.classes,e=b.settings=f.merge(b.defaults,{attachTo:a},c||{}),r=b.container=f.make("div",{"class":d.container}),x=b.calendars=[],j=h().day(e.weekStart),m,n=[],g,k,y;g=[];var l;k=0;m=e.months;for(k=7;k--;)n.push(j.format("ddd").substr(0,e.columnHeaderLength)),j.add("days",1);A(b);if("object"===typeof e.subscribe)for(k in e.subscribe)e.subscribe.hasOwnProperty(k)&&b.subscribe(k,e.subscribe[k]);b._sel=[];
-e.selected&&b.setSelected(e.selected,!1);m=e.viewStartDate?h(e.viewStartDate,e.format):0<b._sel.length?h(b._sel[0]):h();b.viewStartDate=m.date(1);if((m={past:e.months-1,"today-past":e.months-1,any:2<e.months?Math.floor(e.months/2):0,"today-future":0,future:0}[this.settings.direction])&&h().month()==h(b.viewStartDate).month())b.viewStartDate=h(b.viewStartDate).subtract({M:m}).date(1);if("function"===typeof e.blackout)b.blackout=e.blackout;else if(e.blackout){var w=z(e.blackout,e.parseSplitDelimiter);
-b.blackout=function(a){a=h(a).yearDay();if(1>a||!b._sel||1>b._sel.length)return!1;for(var c=w.length;c--;)if(w[c].yearDay()===a)return!0;return!1}}else b.blackout=function(){return!1};b.direction=b.directions[e.direction]?b.directions[e.direction]:b.directions.any;for(m=Math.max(e.months,1);m--;){g=f.make("div",{"class":d.calendar},r);g.setAttribute("data-cal-index",m);1<e.months&&(m==Math.max(e.months-1,1)?f.addClassName(g,d.monthFirst):0===m?f.addClassName(g,d.monthLast):f.addClassName(g,d.monthMiddle));
-k=f.make("div",{"class":d.title},g);f.make("a",{"class":d.previousYear},k);f.make("a",{"class":d.previousMonth},k);f.make("a",{"class":d.nextYear},k);f.make("a",{"class":d.nextMonth},k);j=f.make("span",{"class":d.caption},k);y=f.make("div",{"class":d.header},g);k=0;do l=f.make("span",{},y),l.innerHTML=n[k];while(7>++k);y=f.make("div",{"class":d.days},g);k=0;for(g=[];42>k++;)g.push(f.make("span",{},y));x.push({caption:j,days:g});m&&f.make("div",{"class":d.monthSeparator},r)}b.draw();f.addEvent(r,"mousedown",
-function(a,c){var g;if(f.hasClassName(c,d.nextMonth))!b.disableNext&&!1!==b.publish("view-changed",b,["next-month"])&&(b.viewStartDate.add("months",1),b.draw());else if(f.hasClassName(c,d.previousMonth))!b.disablePreviousMonth&&!1!==b.publish("view-changed",b,["previous-month"])&&(b.viewStartDate.subtract("months",1),b.draw());else if(f.hasClassName(c,d.nextYear))!b.disableNext&&!1!==b.publish("view-changed",b,["next-year"])&&(b.viewStartDate.add("years",1),b.draw());else if(f.hasClassName(c,d.previousYear))!b.disablePreviousMonth&&
-!1!==b.publish("view-changed",b,["previous-year"])&&(b.viewStartDate.subtract("years",1),b.draw());else if(f.hasClassName(c.parentNode,d.days)&&f.hasClassName(c,d.dayActive)&&(g=c.getAttribute("data-date")))if(g=h(g,e.dayAttributeFormat).hours(12),!1!==b.publish("date-clicked",b,[g]))switch(e.mode){case "multiple":b.addSelected(g)||b.removeSelected(g);break;case "range":b.addSelected(g);break;default:b.addSelected(g)}return!1});(e.attachTo=f.$(e.attachTo))&&e.attachTo.appendChild(r)};j.prototype=
-{defaults:{attachTo:null,months:1,weekStart:0,direction:"any",directionScrolling:!0,viewStartDate:null,blackout:null,selected:null,mode:"single",format:null,subscribe:null,columnHeaderLength:2,titleFormat:"MMMM, YYYY",dayNumberFormat:"D",dayAttributeFormat:"YYYY-MM-DD",parseSplitDelimiter:/,\s*|\s+-\s+/,rangeDelimiter:" - ",multipleDelimiter:", ",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",dayOutOfMonth:"k-out-of-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"},
-disablePreviousMonth:!1,disableNextMonth:!1,disablePreviousYear:!1,disableNextYear:!1,directions:{past:function(a){return h(a).yearDay()>=l.yearDay()},"today-past":function(a){return h(a).yearDay()>l.yearDay()},any:function(){return!1},"today-future":function(a){return h(a).yearDay()<l.yearDay()},future:function(a){return h(a).yearDay()<=l.yearDay()}},getSelectedAsDates:function(){for(var a=[],c=0,b=this._sel.length;c<b;c++)a.push(this._sel[c].nativeDate());return a},getSelectedAsText:function(a){for(var c=
-[],b=0,d=this._sel.length;b<d;b++)c.push(this._sel[b].format(a||this.settings.format||"YYYY-MM-DD"));return c},getSelectedRaw:function(){for(var a=[],c=0,b=this._sel.length;c<b;c++)a.push(h(this._sel[c]));return a},getSelected:function(a){a=this.getSelectedAsText(a);switch(this.settings.mode){case "range":return a.splice(2),a.join(this.settings.rangeDelimiter);case "multiple":return a.join(this.settings.multipleDelimiter);default:return a[0]}},isSelected:function(a){a=h(a).yearDay();if(1>a||!this._sel||
-1>this._sel.length)return!1;switch(this.settings.mode){case "range":var c=this._sel[0]?this._sel[0].yearDay():0,b=this._sel[1]?this._sel[1].yearDay():0;return c===a||b===a?1:!c||!b?0:a>c&&a<b||c<b&&a<c&&a>b?-1:!1;case "multiple":for(c=this._sel.length;c--;)if(this._sel[c].yearDay()===a)return!0;return!1;default:return this._sel[0]&&this._sel[0].yearDay()===a}},setSelected:function(a,c){this._sel=z(a,this.settings.parseSplitDelimiter,this.settings.format);this._sel.sort(function(a,c){return a.yearDay()-
-c.yearDay()});!1!==c&&this.draw()},addSelected:function(a,c){a=h(a).hours(12);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.yearDay()>this._sel[0].yearDay()?this._sel[1]=a:this._sel=[a,this._sel[0]];break;default:this._sel=[a]}this._sel.sort(function(a,c){return a.yearDay()-c.yearDay()});this.publish("change",this);!1!==c&&this.draw();return!0},removeSelected:function(a,c){for(var a=h(a).yearDay(),
-b=this._sel.length;b--;)if(this._sel[b].yearDay()===a)return this._sel.splice(b,1),this.publish("change",this),!1!==c&&this.draw(),!0;return!1},draw:function(){var a=h(this.viewStartDate).hours(12),c,b=this.classes,d,e,r,j=0,D,m=0,n,g=this.settings;D=this.calendars.length;do{c=h(a).date(1);c.day(c.day()<this.settings.weekStart?this.settings.weekStart-7:this.settings.weekStart);d=this.calendars[j];d.caption.innerHTML=a.format(this.settings.titleFormat);m=0;do e=d.days[m],r=[],(n=this.isSelected(c))&&
-r.push({"-1":b.dayInRange,1:b.daySelected,"true":b.daySelected}[n]),c.month()!=a.month()?r.push(b.dayOutOfMonth):(!this.blackout(c)&&!this.direction(c)||0<n)&&r.push(b.dayActive),c.yearDay()===l.yearDay()&&r.push(b.dayToday),n=c.format(this.settings.dayAttributeFormat),g.dateClassMap[n]&&r.push(g.dateClassMap[n]),e.innerHTML=c.format(g.dayNumberFormat),e.className=r.join(" "),e.setAttribute("data-date",n),c.add("days",1);while(42>++m);a.add("months",1)}while(++j<D);if(g.directionScrolling){c=-h().diff(a,
-"months");if("today-past"===g.direction||"past"===g.direction)0>=c?(this.disableNextMonth=!1,f.removeClassName(this.container,b.disableNextMonth)):(this.disableNextMonth=!0,f.addClassName(this.container,b.disableNextMonth));else if("today-future"===g.direction||"future"===g.direction)c>g.months?(this.disablePreviousMonth=!1,f.removeClassName(this.container,b.disablePreviousMonth)):(this.disablePreviousMonth=!0,f.addClassName(this.container,b.disablePreviousMonth));if("today-past"===g.direction||"past"===
-g.direction)0>a.add({Y:1}).diff(h(),"years")?(this.disableNextYear=!1,f.removeClassName(this.container,b.disableNextYear)):(this.disableNextYear=!0,f.addClassName(this.container,b.disableNextYear));else if("today-future"===g.direction||"future"===g.direction)0<a.subtract({Y:1}).diff(h(),"years")?(this.disablePreviousYear=!1,f.removeClassName(this.container,b.disablePreviousYear)):(this.disablePreviousYear=!0,f.addClassName(this.container,b.disablePreviousYear))}}};var z=function(a,c,b){var d=[];"string"===
-typeof a?a=a.split(c):f.isArray(a)||(a=[a]);c=a.length;i=0;do a[i]&&d.push(h(a[i],b).hours(12));while(++i<c);return d};window.Kalendae=j;var f=j.util={$:function(a){return"string"==typeof a?document.getElementById(a):a},$$:function(a){return document.querySelectorAll(a)},make:function(a,c,b){var d,a=document.createElement(a);if(c)for(d in c)c.hasOwnProperty(d)&&a.setAttribute(d,c[d]);b&&b.appendChild(a);return a},isVisible:function(a){return 0<a.offsetWidth||0<a.offsetHeight},getStyle:function(a,
-c){var b;a.currentStyle?b=a.currentStyle[c]:window.getComputedStyle&&(b=window.getComputedStyle(a,null)[c]);return b},domReady:function(a){/in/.test(document.readyState)?setTimeout(function(){f.domReady(a)},9):a()},addEvent:function(a,c,b){var d=function(c){var c=c||window.event,d=b.apply(a,[c,c.target||c.srcElement]);!1===d&&(c.preventDefault?c.preventDefault():(c.returnValue=!1,c.cancelBubble=!0));return d};a.attachEvent?a.attachEvent("on"+c,d):a.addEventListener(c,d,!1);return d},removeEvent:function(a,
-c,b){a.detachEvent?a.detachEvent("on"+c,b):a.removeEventListener(c,b,!1)},hasClassName:function(a,c){if(!(a=f.$(a)))return!1;var b=a.className;return 0<b.length&&(b==c||RegExp("(^|\\s)"+c+"(\\s|$)").test(b))},addClassName:function(a,c){if((a=f.$(a))&&!f.hasClassName(a,c))a.className+=(a.className?" ":"")+c},removeClassName:function(a,c){if(a=f.$(a))a.className=f.trimString(a.className.replace(RegExp("(^|\\s+)"+c+"(\\s+|$)")," "))},isFixed:function(a){do if("fixed"===f.getStyle(a,"position"))return!0;
-while(a=a.offsetParent);return!1},getPosition:function(a,c){var b=a.offsetLeft,d=a.offsetTop,e={};if(!c)for(;a=a.offsetParent;)b+=a.offsetLeft,d+=a.offsetTop;e[0]=e.left=b;e[1]=e.top=d;return e},getHeight:function(a){return a.offsetHeight||a.scrollHeight},getWidth:function(a){return a.offsetWidth||a.scrollWidth},trimString:function(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")},merge:function(){for(var a=!0===arguments[0],c={},b=a?1:0;b<arguments.length;b++){var d=c,e=arguments[b];if("object"===
-typeof e){var f=void 0;for(f in e)e.hasOwnProperty(f)&&(a&&"object"===typeof d[f]&&"object"===typeof e[f]?_update(d[f],e[f]):d[f]=e[f])}}return c},isArray:function(a){return!(!a||!a.length||0===a.length||"object"!==typeof a||!a.constructor||a.nodeType||a.item)}};j.util.domReady(function(){for(var a=f.$$(".auto-kal"),c=a.length,b;c--;)b=a[c],"INPUT"===b.tagName?new j.Input(b):new j({attachTo:b})});j.Input=function(a,c){var b=this.input=f.$(a),d;if(!b||"INPUT"!==b.tagName)throw"First argument for Kalendae.Input must be an <input> element or a valid element id.";
-var e=this,h=e.classes;opts=e.settings=f.merge(e.defaults,c);opts.attachTo=window.document.body;opts.selected?d=!0:opts.selected=b.value;j.call(e,opts);d&&(b.value=e.getSelected());d=e.container;var x=!1;d.style.display="none";f.addClassName(d,h.positioned);f.addEvent(d,"mousedown",function(){x=true});f.addEvent(window.document,"mousedown",function(){x=false});f.addEvent(b,"focus",function(){e.setSelected(this.value);e.show()});f.addEvent(b,"blur",function(){if(x){x=false;b.focus()}else e.hide()});
-f.addEvent(b,"keyup",function(){e.setSelected(this.value)});e.subscribe("change",function(){b.value=e.getSelected()})};j.Input.prototype=f.merge(j.prototype,{defaults:f.merge(j.prototype.defaults,{format:"MM/DD/YYYY",side:"bottom",offsetLeft:0,offsetTop:0}),classes:f.merge(j.prototype.classes,{positioned:"k-floating"}),show:function(){var a=this.container,c=a.style,b=this.input,d=f.getPosition(b);c.display="";switch(opts.side){case "left":c.left=d.left-f.getWidth(a)+this.settings.offsetLeft+"px";
-c.top=d.top+this.settings.offsetTop+"px";break;case "right":c.left=d.left+f.getWidth(b)+"px";c.top=d.top+this.settings.offsetTop+"px";break;case "top":c.left=d.left+this.settings.offsetLeft+"px";c.top=d.top-f.getHeight(a)+this.settings.offsetTop+"px";break;default:c.left=d.left+this.settings.offsetLeft+"px",c.top=d.top+f.getHeight(b)+this.settings.offsetTop+"px"}c.position=f.isFixed(b)?"fixed":"absolute"},hide:function(){this.container.style.display="none"}});var A=function(a){a||(a=this);var c=a.c_||
-{};a.publish=function(a,d,e){for(var f=(a=c[a])?a.length:0,h;f--;)if(h=a[f].apply(d,e||[]),"boolean"===typeof h)return h};a.subscribe=function(a,d,e){c[a]||(c[a]=[]);e?c[a].push(d):c[a].unshift(d);return[a,d]};a.unsubscribe=function(a){for(var d=c[a[0]],a=a[1],e=d?d.length:0;e--;)d[e]===a&&d.splice(e,1)}},h=j.moment=function(a,c){function b(a){this._d=a}function d(a,b){for(var c=a+"";c.length<b;)c="0"+c;return c}function e(b,c,d,f){var e="string"===typeof c,g=e?{}:c;e&&f&&(g[c]=f);c=(g.ms||g.milliseconds||
-0)+1E3*(g.s||g.seconds||0)+6E4*(g.m||g.minutes||0)+36E5*(g.h||g.hours||0);f=(g.d||g.days||0)+7*(g.w||g.weeks||0);g=(g.M||g.months||0)+12*(g.y||g.years||0);c&&b.setTime(+b+c*d);f&&b.setDate(b.getDate()+f*d);g&&(c=b.getDate(),b.setDate(1),b.setMonth(b.getMonth()+g*d),b.setDate(Math.min((new a(b.getFullYear(),b.getMonth()+1,0)).getDate(),c)));return b}function f(b){return new a(b[0],b[1]||0,b[2]||1,b[3]||0,b[4]||0,b[5]||0,b[6]||0)}function h(c,f){function e(b){var f;switch(b){case "M":return v+1;case "Mo":return v+
-1+l(v+1);case "MM":return d(v+1,2);case "MMM":return g.monthsShort[v];case "MMMM":return g.months[v];case "D":return k;case "Do":return k+l(k);case "DD":return d(k,2);case "DDD":return b=new a(j,v,k),f=new a(j,0,1),~~((b-f)/864E5+1.5);case "DDDo":return b=e("DDD"),b+l(b);case "DDDD":return d(e("DDD"),3);case "d":return q;case "do":return q+l(q);case "ddd":return g.weekdaysShort[q];case "dddd":return g.weekdays[q];case "w":return b=new a(j,v,k-q+5),f=new a(b.getFullYear(),0,4),~~((b-f)/864E5/7+1.5);
-case "wo":return b=e("w"),b+l(b);case "ww":return d(e("w"),2);case "YY":return d(j%100,2);case "YYYY":return j;case "a":return 11<t?n.pm:n.am;case "A":return 11<t?n.PM:n.AM;case "H":return t;case "HH":return d(t,2);case "h":return t%12||12;case "hh":return d(t%12||12,2);case "m":return m;case "mm":return d(m,2);case "s":return p;case "ss":return d(p,2);case "zz":case "z":return(c.toString().match(F)||[""])[0].replace(E,"");case "Z":return(0<o?"+":"-")+d(~~(Math.abs(o)/60),2)+":"+d(~~(Math.abs(o)%
-60),2);case "ZZ":return(0<o?"+":"-")+d(~~(10*Math.abs(o)/6),4);case "L":case "LL":case "LLL":case "LLLL":case "LT":return h(c,g.longDateFormat[b]);default:return b.replace(/(^\[)|(\\)|\]$/g,"")}}var u=new b(c),v=u.month(),k=u.date(),j=u.year(),q=u.day(),t=u.hours(),m=u.minutes(),p=u.seconds(),o=u.zone(),l=g.ordinal,n=g.meridiem;return f.replace(A,e)}function j(b,c){var d=[0,0,1,0,0,0,0],e=0,h=0,k=!1,m=b.match(B),q=c.match(G),l,n;for(l=0;l<q.length;l++){var p=m[l],o=void 0;switch(q[l]){case "M":case "MM":d[1]=
-~~p-1;break;case "MMM":case "MMMM":for(o=0;12>o;o++)if(g.monthsParse[o].test(p)){d[1]=o;break}break;case "D":case "DD":case "DDD":case "DDDD":d[2]=~~p;break;case "YY":p=~~p;d[0]=p+(70<p?1900:2E3);break;case "YYYY":d[0]=~~Math.abs(p);break;case "a":case "A":n="pm"===p.toLowerCase();break;case "H":case "HH":case "h":case "hh":d[3]=~~p;break;case "m":case "mm":d[4]=~~p;break;case "s":case "ss":d[5]=~~p;break;case "Z":case "ZZ":k=!0,o=p.match(H),o[1]&&(e=~~o[1]),o[2]&&(h=~~o[2]),"-"===o[0]&&(e=-e,h=-h)}}n&&
-12>d[3]&&(d[3]+=12);!1===n&&12===d[3]&&(d[3]=0);d[3]+=e;d[4]+=h;return k?new a(a.UTC.apply({},d)):f(d)}function m(a,b,c){var d=g.relativeTime[a];return"function"===typeof d?d(b||1,!!c,a):d.replace(/%d/i,b||1)}function n(a,b){g.fn[a]=function(a){return"undefined"!==typeof a?(this._d["set"+b](a),this):this._d["get"+b]()}}var g,k=Math.round,l={},z="undefined"!==typeof module,w="months,monthsShort,monthsParse,weekdays,weekdaysShort,longDateFormat,calendar,relativeTime,ordinal,meridiem".split(","),s,A=
-/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|ZZ?|LT|LL?L?L?)/g,E=/[^A-Z]/g,F=/\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,G=/(\\)?(MM?M?M?|dd?d?d|DD?D?D?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|ZZ?|T)/g,B=/(\\)?([0-9]+|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+|([\+\-]\d\d:?\d\d))/gi,H=/([\+\-]|\d\d)/gi,C="Month,Date,Hours,Minutes,Seconds,Milliseconds".split(",");g=function(d,e){if(null===d)return null;var g;if(d&&d._d instanceof a)g=new a(+d._d);else if(e)if("[object Array]"===
-Object.prototype.toString.call(e)){var k=d.match(B),l=99,m,n,q;for(m=0;m<e.length;m++){n=j(d,e[m]);q=k;for(var t=h(n,e[m]).match(B),w=Math.min(q.length,t.length),p=Math.abs(q.length-t.length),o=0,s=void 0,s=0;s<w;s++)~~q[s]!==~~t[s]&&o++;q=o+p;q<l&&(l=q,g=n)}}else g=j(d,e);else g=d===c?new a:d instanceof a?d:"[object Array]"===Object.prototype.toString.call(d)?f(d):new a(d);return new b(g)};g.version="1.3.0";g.lang=function(a,b){var c,d;d=[];if(b){for(c=0;12>c;c++)d[c]=RegExp("^"+b.months[c]+"|^"+
-b.monthsShort[c].replace(".",""),"i");b.monthsParse=b.monthsParse||d;l[a]=b}if(l[a])for(c=0;c<w.length;c++)d=w[c],g[d]=l[a][d]||g[d];else z&&(c=require("./lang/"+a),g.lang(a,c))};g.lang("en",{months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),
-longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},
-ordinal:function(a){var b=a%10;return 1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th"}});g.fn=b.prototype={clone:function(){return g(this)},valueOf:function(){return+this._d},nativeDate:function(){return this._d},toString:function(){return this._d.toString()},toDate:function(){return this._d},format:function(a){return h(this._d,a)},add:function(a,b){this._d=e(this._d,a,1,b);return this},subtract:function(a,b){this._d=e(this._d,a,-1,b);return this},diff:function(a,b,c){var d=g(a),a=this._d-
-d._d,e=this.year()-d.year(),f=this.month()-d.month(),d=this.day()-d.day(),b="months"===b?12*e+f+d/30:"years"===b?e+f/12:"seconds"===b?a/1E3:"minutes"===b?a/6E4:"hours"===b?a/36E5:"days"===b?a/864E5:"weeks"===b?a/6048E5:"days"===b?a/3600:a;return c?b:k(b)},from:function(a,b){var c=this.diff(a),d=g.relativeTime,e;e=k(Math.abs(c)/1E3);var f=k(e/60),h=k(f/60),j=k(h/24),l=k(j/365);e=45>e&&["s",e]||1===f&&["m"]||45>f&&["mm",f]||1===h&&["h"]||22>h&&["hh",h]||1===j&&["d"]||25>=j&&["dd",j]||45>=j&&["M"]||
-345>j&&["MM",k(j/30)]||1===l&&["y"]||["yy",l];e[2]=b;e=m.apply({},e);return b?e:(0>=c?d.past:d.future).replace(/%s/i,e)},fromNow:function(a){return this.from(g(),a)},calendar:function(){var a=g(),a=this.diff(g([a.year(),a.month(),a.date()]),"days",!0),b=g.calendar,c=b.sameElse,a=-6>a?c:-1>a?b.lastWeek:0>a?b.lastDay:1>a?b.sameDay:2>a?b.nextDay:7>a?b.nextWeek:c;return this.format("function"===typeof a?a.apply(this):a)},isLeapYear:function(){var a=this.year();return 0===a%4&&0!==a%100||0===a%400},isDST:function(){return this.zone()!==
-g([this.year()]).zone()},day:function(a){var b=this._d.getDay();return"undefined"===typeof a?b:this.add({d:a-b})}};for(s=0;s<C.length;s++)n(C[s].toLowerCase(),C[s]);n("year","FullYear");g.fn.zone=function(){return this._d.getTimezoneOffset()};return g}(Date);h.fn.stripTime=function(){this._d=new Date(864E5*Math.floor(this._d.valueOf()/864E5));return this};h.fn.yearDay=function(a){var c=Math.floor(this._d/864E5);return"undefined"===typeof a?c:this.add({d:a-c})};l=h().stripTime();"undefined"!==typeof jQuery&&
-(jQuery.fn.kalendae=function(a){this.each(function(c,b){"INPUT"===b.tagName?$(b).data("kalendae",new j.Input(b,a)):$(b).data("kalendae",new j($.extend({},{attachTo:b},a)))});return this})})();
+(function(){var l,o=function(a,c){a instanceof Element||"string"===typeof a||(c=a);var b=this,d=b.classes,f=b.settings=e.merge(b.defaults,{attachTo:a},c||{}),q=b.container=e.make("div",{"class":d.container}),o=b.calendars=[],j=h().day(f.weekStart),m,p=[],g,k,y;g=[];var l;k=0;m=f.months;e.isIE8()&&e.addClassName(q,"ie8");for(k=7;k--;)p.push(j.format("ddd").substr(0,f.columnHeaderLength)),j.add("days",1);A(b);if("object"===typeof f.subscribe)for(k in f.subscribe)f.subscribe.hasOwnProperty(k)&&b.subscribe(k,
+f.subscribe[k]);b._sel=[];f.selected&&b.setSelected(f.selected,!1);m=f.viewStartDate?h(f.viewStartDate,f.format):0<b._sel.length?h(b._sel[0]):h();b.viewStartDate=m.date(1);if((m={past:f.months-1,"today-past":f.months-1,any:2<f.months?Math.floor(f.months/2):0,"today-future":0,future:0}[this.settings.direction])&&h().month()==h(b.viewStartDate).month())b.viewStartDate=h(b.viewStartDate).subtract({M:m}).date(1);if("function"===typeof f.blackout)b.blackout=f.blackout;else if(f.blackout){var u=z(f.blackout,
+f.parseSplitDelimiter);b.blackout=function(a){a=h(a).yearDay();if(1>a||!b._sel||1>b._sel.length)return!1;for(var c=u.length;c--;)if(u[c].yearDay()===a)return!0;return!1}}else b.blackout=function(){return!1};b.direction=b.directions[f.direction]?b.directions[f.direction]:b.directions.any;for(m=Math.max(f.months,1);m--;){g=e.make("div",{"class":d.calendar},q);g.setAttribute("data-cal-index",m);1<f.months&&(m==Math.max(f.months-1,1)?e.addClassName(g,d.monthFirst):0===m?e.addClassName(g,d.monthLast):
+e.addClassName(g,d.monthMiddle));k=e.make("div",{"class":d.title},g);e.make("a",{"class":d.previousYear},k);e.make("a",{"class":d.previousMonth},k);e.make("a",{"class":d.nextYear},k);e.make("a",{"class":d.nextMonth},k);j=e.make("span",{"class":d.caption},k);y=e.make("div",{"class":d.header},g);k=0;do l=e.make("span",{},y),l.innerHTML=p[k];while(7>++k);y=e.make("div",{"class":d.days},g);k=0;for(g=[];42>k++;)g.push(e.make("span",{},y));o.push({caption:j,days:g});m&&e.make("div",{"class":d.monthSeparator},
+q)}b.draw();e.addEvent(q,"mousedown",function(a,c){var g;if(e.hasClassName(c,d.nextMonth))!b.disableNext&&!1!==b.publish("view-changed",b,["next-month"])&&(b.viewStartDate.add("months",1),b.draw());else if(e.hasClassName(c,d.previousMonth))!b.disablePreviousMonth&&!1!==b.publish("view-changed",b,["previous-month"])&&(b.viewStartDate.subtract("months",1),b.draw());else if(e.hasClassName(c,d.nextYear))!b.disableNext&&!1!==b.publish("view-changed",b,["next-year"])&&(b.viewStartDate.add("years",1),b.draw());
+else if(e.hasClassName(c,d.previousYear))!b.disablePreviousMonth&&!1!==b.publish("view-changed",b,["previous-year"])&&(b.viewStartDate.subtract("years",1),b.draw());else if(e.hasClassName(c.parentNode,d.days)&&e.hasClassName(c,d.dayActive)&&(g=c.getAttribute("data-date")))if(g=h(g,f.dayAttributeFormat).hours(12),!1!==b.publish("date-clicked",b,[g]))switch(f.mode){case "multiple":b.addSelected(g)||b.removeSelected(g);break;case "range":b.addSelected(g);break;default:b.addSelected(g)}return!1});(f.attachTo=
+e.$(f.attachTo))&&f.attachTo.appendChild(q)};o.prototype={defaults:{attachTo:null,months:1,weekStart:0,direction:"any",directionScrolling:!0,viewStartDate:null,blackout:null,selected:null,mode:"single",format:null,subscribe:null,columnHeaderLength:2,titleFormat:"MMMM, YYYY",dayNumberFormat:"D",dayAttributeFormat:"YYYY-MM-DD",parseSplitDelimiter:/,\s*|\s+-\s+/,rangeDelimiter:" - ",multipleDelimiter:", ",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",dayOutOfMonth:"k-out-of-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"},disablePreviousMonth:!1,disableNextMonth:!1,disablePreviousYear:!1,disableNextYear:!1,directions:{past:function(a){return h(a).yearDay()>=l.yearDay()},"today-past":function(a){return h(a).yearDay()>l.yearDay()},any:function(){return!1},"today-future":function(a){return h(a).yearDay()<l.yearDay()},future:function(a){return h(a).yearDay()<=l.yearDay()}},getSelectedAsDates:function(){for(var a=[],c=0,b=this._sel.length;c<b;c++)a.push(this._sel[c].nativeDate());
+return a},getSelectedAsText:function(a){for(var c=[],b=0,d=this._sel.length;b<d;b++)c.push(this._sel[b].format(a||this.settings.format||"YYYY-MM-DD"));return c},getSelectedRaw:function(){for(var a=[],c=0,b=this._sel.length;c<b;c++)a.push(h(this._sel[c]));return a},getSelected:function(a){a=this.getSelectedAsText(a);switch(this.settings.mode){case "range":return a.splice(2),a.join(this.settings.rangeDelimiter);case "multiple":return a.join(this.settings.multipleDelimiter);default:return a[0]}},isSelected:function(a){a=
+h(a).yearDay();if(1>a||!this._sel||1>this._sel.length)return!1;switch(this.settings.mode){case "range":var c=this._sel[0]?this._sel[0].yearDay():0,b=this._sel[1]?this._sel[1].yearDay():0;return c===a||b===a?1:!c||!b?0:a>c&&a<b||c<b&&a<c&&a>b?-1:!1;case "multiple":for(c=this._sel.length;c--;)if(this._sel[c].yearDay()===a)return!0;return!1;default:return this._sel[0]&&this._sel[0].yearDay()===a}},setSelected:function(a,c){this._sel=z(a,this.settings.parseSplitDelimiter,this.settings.format);this._sel.sort(function(a,
+c){return a.yearDay()-c.yearDay()});!1!==c&&this.draw()},addSelected:function(a,c){a=h(a).hours(12);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.yearDay()>this._sel[0].yearDay()?this._sel[1]=a:this._sel=[a,this._sel[0]];break;default:this._sel=[a]}this._sel.sort(function(a,c){return a.yearDay()-c.yearDay()});this.publish("change",this);!1!==c&&this.draw();return!0},removeSelected:function(a,c){for(var a=
+h(a).yearDay(),b=this._sel.length;b--;)if(this._sel[b].yearDay()===a)return this._sel.splice(b,1),this.publish("change",this),!1!==c&&this.draw(),!0;return!1},draw:function(){var a=h(this.viewStartDate).hours(12),c,b=this.classes,d,f,q,o=0,j,m=0,p,g=this.settings;j=this.calendars.length;do{c=h(a).date(1);c.day(c.day()<this.settings.weekStart?this.settings.weekStart-7:this.settings.weekStart);d=this.calendars[o];d.caption.innerHTML=a.format(this.settings.titleFormat);m=0;do f=d.days[m],q=[],(p=this.isSelected(c))&&
+q.push({"-1":b.dayInRange,1:b.daySelected,"true":b.daySelected}[p]),c.month()!=a.month()?q.push(b.dayOutOfMonth):(!this.blackout(c)&&!this.direction(c)||0<p)&&q.push(b.dayActive),c.yearDay()===l.yearDay()&&q.push(b.dayToday),p=c.format(this.settings.dayAttributeFormat),g.dateClassMap[p]&&q.push(g.dateClassMap[p]),f.innerHTML=c.format(g.dayNumberFormat),f.className=q.join(" "),f.setAttribute("data-date",p),c.add("days",1);while(42>++m);a.add("months",1)}while(++o<j);if(g.directionScrolling){c=-h().diff(a,
+"months");if("today-past"===g.direction||"past"===g.direction)0>=c?(this.disableNextMonth=!1,e.removeClassName(this.container,b.disableNextMonth)):(this.disableNextMonth=!0,e.addClassName(this.container,b.disableNextMonth));else if("today-future"===g.direction||"future"===g.direction)c>g.months?(this.disablePreviousMonth=!1,e.removeClassName(this.container,b.disablePreviousMonth)):(this.disablePreviousMonth=!0,e.addClassName(this.container,b.disablePreviousMonth));if("today-past"===g.direction||"past"===
+g.direction)0>a.add({Y:1}).diff(h(),"years")?(this.disableNextYear=!1,e.removeClassName(this.container,b.disableNextYear)):(this.disableNextYear=!0,e.addClassName(this.container,b.disableNextYear));else if("today-future"===g.direction||"future"===g.direction)0<a.subtract({Y:1}).diff(h(),"years")?(this.disablePreviousYear=!1,e.removeClassName(this.container,b.disablePreviousYear)):(this.disablePreviousYear=!0,e.addClassName(this.container,b.disablePreviousYear))}}};var z=function(a,c,b){var d=[];"string"===
+typeof a?a=a.split(c):e.isArray(a)||(a=[a]);c=a.length;i=0;do a[i]&&d.push(h(a[i],b).hours(12));while(++i<c);return d};window.Kalendae=o;var e=o.util={isIE8:function(){return!(!/msie 8./i.test(navigator.appVersion)||/opera/i.test(navigator.userAgent)||!window.ActiveXObject||!XDomainRequest||window.msPerformance)},$:function(a){return"string"==typeof a?document.getElementById(a):a},$$:function(a){return document.querySelectorAll(a)},make:function(a,c,b){var d,a=document.createElement(a);if(c)for(d in c)c.hasOwnProperty(d)&&
+a.setAttribute(d,c[d]);b&&b.appendChild(a);return a},isVisible:function(a){return 0<a.offsetWidth||0<a.offsetHeight},getStyle:function(a,c){var b;a.currentStyle?b=a.currentStyle[c]:window.getComputedStyle&&(b=window.getComputedStyle(a,null)[c]);return b},domReady:function(a){/in/.test(document.readyState)?setTimeout(function(){e.domReady(a)},9):a()},addEvent:function(a,c,b){var d=function(c){var c=c||window.event,d=b.apply(a,[c,c.target||c.srcElement]);!1===d&&(c.preventDefault?c.preventDefault():
+(c.returnValue=!1,c.cancelBubble=!0));return d};a.attachEvent?a.attachEvent("on"+c,d):a.addEventListener(c,d,!1);return d},removeEvent:function(a,c,b){a.detachEvent?a.detachEvent("on"+c,b):a.removeEventListener(c,b,!1)},hasClassName:function(a,c){if(!(a=e.$(a)))return!1;var b=a.className;return 0<b.length&&(b==c||RegExp("(^|\\s)"+c+"(\\s|$)").test(b))},addClassName:function(a,c){if((a=e.$(a))&&!e.hasClassName(a,c))a.className+=(a.className?" ":"")+c},removeClassName:function(a,c){if(a=e.$(a))a.className=
+e.trimString(a.className.replace(RegExp("(^|\\s+)"+c+"(\\s+|$)")," "))},isFixed:function(a){do if("fixed"===e.getStyle(a,"position"))return!0;while(a=a.offsetParent);return!1},getPosition:function(a,c){var b=a.offsetLeft,d=a.offsetTop,f={};if(!c)for(;a=a.offsetParent;)b+=a.offsetLeft,d+=a.offsetTop;f[0]=f.left=b;f[1]=f.top=d;return f},getHeight:function(a){return a.offsetHeight||a.scrollHeight},getWidth:function(a){return a.offsetWidth||a.scrollWidth},trimString:function(a){return a.replace(/^\s+/,
+"").replace(/\s+$/,"")},merge:function(){for(var a=!0===arguments[0],c={},b=a?1:0;b<arguments.length;b++){var d=c,f=arguments[b];if("object"===typeof f){var e=void 0;for(e in f)f.hasOwnProperty(e)&&(a&&"object"===typeof d[e]&&"object"===typeof f[e]?_update(d[e],f[e]):d[e]=f[e])}}return c},isArray:function(a){return!(!a||!a.length||0===a.length||"object"!==typeof a||!a.constructor||a.nodeType||a.item)}};o.util.domReady(function(){for(var a=e.$$(".auto-kal"),c=a.length,b;c--;)b=a[c],"INPUT"===b.tagName?
+new o.Input(b):new o({attachTo:b})});o.Input=function(a,c){var b=this.input=e.$(a),d;if(!b||"INPUT"!==b.tagName)throw"First argument for Kalendae.Input must be an <input> element or a valid element id.";var f=this,h=f.classes;opts=f.settings=e.merge(f.defaults,c);opts.attachTo=window.document.body;opts.selected?d=!0:opts.selected=b.value;o.call(f,opts);if(opts.closeButton){var l=e.make("a",{"class":h.closeButton},f.container);e.addEvent(l,"click",function(){b.blur()})}d&&(b.value=f.getSelected());
+d=f.container;var j=!1;d.style.display="none";e.addClassName(d,h.positioned);e.addEvent(d,"mousedown",function(){j=true});e.addEvent(window.document,"mousedown",function(){j=false});e.addEvent(b,"focus",function(){f.setSelected(this.value);f.show()});e.addEvent(b,"blur",function(){if(j){j=false;b.focus()}else f.hide()});e.addEvent(b,"keyup",function(){f.setSelected(this.value)});f.subscribe("change",function(){b.value=f.getSelected()})};o.Input.prototype=e.merge(o.prototype,{defaults:e.merge(o.prototype.defaults,
+{format:"MM/DD/YYYY",side:"bottom",closeButton:!0,offsetLeft:0,offsetTop:0}),classes:e.merge(o.prototype.classes,{positioned:"k-floating",closeButton:"k-btn-close"}),show:function(){var a=this.container,c=a.style,b=this.input,d=e.getPosition(b);c.display="";switch(opts.side){case "left":c.left=d.left-e.getWidth(a)+this.settings.offsetLeft+"px";c.top=d.top+this.settings.offsetTop+"px";break;case "right":c.left=d.left+e.getWidth(b)+"px";c.top=d.top+this.settings.offsetTop+"px";break;case "top":c.left=
+d.left+this.settings.offsetLeft+"px";c.top=d.top-e.getHeight(a)+this.settings.offsetTop+"px";break;default:c.left=d.left+this.settings.offsetLeft+"px",c.top=d.top+e.getHeight(b)+this.settings.offsetTop+"px"}c.position=e.isFixed(b)?"fixed":"absolute"},hide:function(){this.container.style.display="none"}});var A=function(a){a||(a=this);var c=a.c_||{};a.publish=function(a,d,f){for(var e=(a=c[a])?a.length:0,h;e--;)if(h=a[e].apply(d,f||[]),"boolean"===typeof h)return h};a.subscribe=function(a,d,e){c[a]||
+(c[a]=[]);e?c[a].push(d):c[a].unshift(d);return[a,d]};a.unsubscribe=function(a){for(var d=c[a[0]],a=a[1],e=d?d.length:0;e--;)d[e]===a&&d.splice(e,1)}},h=o.moment=function(a,c){function b(a){this._d=a}function d(a,b){for(var c=a+"";c.length<b;)c="0"+c;return c}function e(b,c,d,f){var g="string"===typeof c,n=g?{}:c;g&&f&&(n[c]=f);c=(n.ms||n.milliseconds||0)+1E3*(n.s||n.seconds||0)+6E4*(n.m||n.minutes||0)+36E5*(n.h||n.hours||0);f=(n.d||n.days||0)+7*(n.w||n.weeks||0);n=(n.M||n.months||0)+12*(n.y||n.years||
+0);c&&b.setTime(+b+c*d);f&&b.setDate(b.getDate()+f*d);n&&(c=b.getDate(),b.setDate(1),b.setMonth(b.getMonth()+n*d),b.setDate(Math.min((new a(b.getFullYear(),b.getMonth()+1,0)).getDate(),c)));return b}function h(b){return new a(b[0],b[1]||0,b[2]||1,b[3]||0,b[4]||0,b[5]||0,b[6]||0)}function o(c,e){function f(b){var e;switch(b){case "M":return h+1;case "Mo":return h+1+l(h+1);case "MM":return d(h+1,2);case "MMM":return g.monthsShort[h];case "MMMM":return g.months[h];case "D":return n;case "Do":return n+
+l(n);case "DD":return d(n,2);case "DDD":return b=new a(k,h,n),e=new a(k,0,1),~~((b-e)/864E5+1.5);case "DDDo":return b=f("DDD"),b+l(b);case "DDDD":return d(f("DDD"),3);case "d":return r;case "do":return r+l(r);case "ddd":return g.weekdaysShort[r];case "dddd":return g.weekdays[r];case "w":return b=new a(k,h,n-r+5),e=new a(b.getFullYear(),0,4),~~((b-e)/864E5/7+1.5);case "wo":return b=f("w"),b+l(b);case "ww":return d(f("w"),2);case "YY":return d(k%100,2);case "YYYY":return k;case "a":return 11<w?j.pm:
+j.am;case "A":return 11<w?j.PM:j.AM;case "H":return w;case "HH":return d(w,2);case "h":return w%12||12;case "hh":return d(w%12||12,2);case "m":return m;case "mm":return d(m,2);case "s":return D;case "ss":return d(D,2);case "zz":case "z":return(c.toString().match(F)||[""])[0].replace(E,"");case "Z":return(0<t?"+":"-")+d(~~(Math.abs(t)/60),2)+":"+d(~~(Math.abs(t)%60),2);case "ZZ":return(0<t?"+":"-")+d(~~(10*Math.abs(t)/6),4);case "L":case "LL":case "LLL":case "LLLL":case "LT":return o(c,g.longDateFormat[b]);
+default:return b.replace(/(^\[)|(\\)|\]$/g,"")}}var s=new b(c),h=s.month(),n=s.date(),k=s.year(),r=s.day(),w=s.hours(),m=s.minutes(),D=s.seconds(),t=s.zone(),l=g.ordinal,j=g.meridiem;return e.replace(A,f)}function j(b,c){var d=[0,0,1,0,0,0,0],e=0,f=0,n=!1,k=b.match(B),r=c.match(G),o,l;for(o=0;o<r.length;o++){var j=k[o],m=void 0;switch(r[o]){case "M":case "MM":d[1]=~~j-1;break;case "MMM":case "MMMM":for(m=0;12>m;m++)if(g.monthsParse[m].test(j)){d[1]=m;break}break;case "D":case "DD":case "DDD":case "DDDD":d[2]=
+~~j;break;case "YY":j=~~j;d[0]=j+(70<j?1900:2E3);break;case "YYYY":d[0]=~~Math.abs(j);break;case "a":case "A":l="pm"===j.toLowerCase();break;case "H":case "HH":case "h":case "hh":d[3]=~~j;break;case "m":case "mm":d[4]=~~j;break;case "s":case "ss":d[5]=~~j;break;case "Z":case "ZZ":n=!0,m=j.match(H),m[1]&&(e=~~m[1]),m[2]&&(f=~~m[2]),"-"===m[0]&&(e=-e,f=-f)}}l&&12>d[3]&&(d[3]+=12);!1===l&&12===d[3]&&(d[3]=0);d[3]+=e;d[4]+=f;return n?new a(a.UTC.apply({},d)):h(d)}function m(a,b,c){var d=g.relativeTime[a];
+return"function"===typeof d?d(b||1,!!c,a):d.replace(/%d/i,b||1)}function p(a,b){g.fn[a]=function(a){return"undefined"!==typeof a?(this._d["set"+b](a),this):this._d["get"+b]()}}var g,k=Math.round,l={},z="undefined"!==typeof module,u="months,monthsShort,monthsParse,weekdays,weekdaysShort,longDateFormat,calendar,relativeTime,ordinal,meridiem".split(","),v,A=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|ZZ?|LT|LL?L?L?)/g,E=/[^A-Z]/g,F=/\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,
+G=/(\\)?(MM?M?M?|dd?d?d|DD?D?D?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|ZZ?|T)/g,B=/(\\)?([0-9]+|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+|([\+\-]\d\d:?\d\d))/gi,H=/([\+\-]|\d\d)/gi,C="Month,Date,Hours,Minutes,Seconds,Milliseconds".split(",");g=function(d,e){if(null===d)return null;var f;if(d&&d._d instanceof a)f=new a(+d._d);else if(e)if("[object Array]"===Object.prototype.toString.call(e)){var g=d.match(B),k=99,n,m,l;for(n=0;n<e.length;n++){m=j(d,e[n]);l=g;for(var p=o(m,e[n]).match(B),u=Math.min(l.length,
+p.length),v=Math.abs(l.length-p.length),t=0,x=void 0,x=0;x<u;x++)~~l[x]!==~~p[x]&&t++;l=t+v;l<k&&(k=l,f=m)}}else f=j(d,e);else f=d===c?new a:d instanceof a?d:"[object Array]"===Object.prototype.toString.call(d)?h(d):new a(d);return new b(f)};g.version="1.3.0";g.lang=function(a,b){var c,d;d=[];if(b){for(c=0;12>c;c++)d[c]=RegExp("^"+b.months[c]+"|^"+b.monthsShort[c].replace(".",""),"i");b.monthsParse=b.monthsParse||d;l[a]=b}if(l[a])for(c=0;c<u.length;c++)d=u[c],g[d]=l[a][d]||g[d];else z&&(c=require("./lang/"+
+a),g.lang(a,c))};g.lang("en",{months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",
+nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return 1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th"}});g.fn=b.prototype={clone:function(){return g(this)},valueOf:function(){return+this._d},
+nativeDate:function(){return this._d},toString:function(){return this._d.toString()},toDate:function(){return this._d},format:function(a){return o(this._d,a)},add:function(a,b){this._d=e(this._d,a,1,b);return this},subtract:function(a,b){this._d=e(this._d,a,-1,b);return this},diff:function(a,b,c){var d=g(a),a=this._d-d._d,e=this.year()-d.year(),f=this.month()-d.month(),d=this.day()-d.day(),b="months"===b?12*e+f+d/30:"years"===b?e+f/12:"seconds"===b?a/1E3:"minutes"===b?a/6E4:"hours"===b?a/36E5:"days"===
+b?a/864E5:"weeks"===b?a/6048E5:"days"===b?a/3600:a;return c?b:k(b)},from:function(a,b){var c=this.diff(a),d=g.relativeTime,e;e=k(Math.abs(c)/1E3);var f=k(e/60),h=k(f/60),j=k(h/24),l=k(j/365);e=45>e&&["s",e]||1===f&&["m"]||45>f&&["mm",f]||1===h&&["h"]||22>h&&["hh",h]||1===j&&["d"]||25>=j&&["dd",j]||45>=j&&["M"]||345>j&&["MM",k(j/30)]||1===l&&["y"]||["yy",l];e[2]=b;e=m.apply({},e);return b?e:(0>=c?d.past:d.future).replace(/%s/i,e)},fromNow:function(a){return this.from(g(),a)},calendar:function(){var a=
+g(),a=this.diff(g([a.year(),a.month(),a.date()]),"days",!0),b=g.calendar,c=b.sameElse,a=-6>a?c:-1>a?b.lastWeek:0>a?b.lastDay:1>a?b.sameDay:2>a?b.nextDay:7>a?b.nextWeek:c;return this.format("function"===typeof a?a.apply(this):a)},isLeapYear:function(){var a=this.year();return 0===a%4&&0!==a%100||0===a%400},isDST:function(){return this.zone()!==g([this.year()]).zone()},day:function(a){var b=this._d.getDay();return"undefined"===typeof a?b:this.add({d:a-b})}};for(v=0;v<C.length;v++)p(C[v].toLowerCase(),
+C[v]);p("year","FullYear");g.fn.zone=function(){return this._d.getTimezoneOffset()};return g}(Date);h.fn.stripTime=function(){this._d=new Date(864E5*Math.floor(this._d.valueOf()/864E5));return this};h.fn.yearDay=function(a){var c=Math.floor(this._d/864E5);return"undefined"===typeof a?c:this.add({d:a-c})};l=h().stripTime();"undefined"!==typeof jQuery&&(jQuery.fn.kalendae=function(a){this.each(function(c,b){"INPUT"===b.tagName?$(b).data("kalendae",new o.Input(b,a)):$(b).data("kalendae",new o($.extend({},
+{attachTo:b},a)))});return this})})();
View
2  src/header.js
@@ -2,6 +2,6 @@
* Kalendae, a framework agnostic javascript date picker *
* Copyright(c) 2012 Jarvis Badgley (chipersoft@gmail.com) *
* http://github.com/ChiperSoft/Kalendae *
- * Version 0.1 *
+ * Version 0.2 *
********************************************************************/
Please sign in to comment.
Something went wrong with that request. Please try again.