diff --git a/.gitignore b/.gitignore index 97de7c20..29c890c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea +.vscode node_modules components/ .DS_Store diff --git a/css/calendar.min.css b/css/calendar.min.css index 5b0ae2b5..087112ce 100644 --- a/css/calendar.min.css +++ b/css/calendar.min.css @@ -1 +1 @@ -[class*=cal-cell]{float:left;margin-left:0;min-height:1px}.cal-row-fluid{width:100%}.cal-row-fluid:after,.cal-row-fluid:before{display:table;content:"";line-height:0}.cal-row-fluid:after{clear:both}.cal-row-fluid [class*=cal-cell]{display:block;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:0}.cal-row-fluid .controls-row [class*=cal-cell]+[class*=cal-cell],.cal-row-fluid [class*=cal-cell]:first-child{margin-left:0}.cal-row-fluid .cal-cell7{width:100%}.cal-row-fluid .cal-cell6{width:85.71428571428571%}.cal-row-fluid .cal-cell5{width:71.42857142857142%}.cal-row-fluid .cal-cell4{width:57.14285714285714%}.cal-row-fluid .cal-cell3{width:42.857142857142854%}.cal-row-fluid .cal-cell2{width:28.57142857142857%}.cal-row-fluid .cal-offset7,.cal-row-fluid .cal-offset7:first-child,.cal-week-box .cal-offset7{margin-left:100%}.cal-row-fluid .cal-offset6,.cal-row-fluid .cal-offset6:first-child,.cal-week-box .cal-offset6{margin-left:85.71428571428571%}.cal-row-fluid .cal-offset5,.cal-row-fluid .cal-offset5:first-child,.cal-week-box .cal-offset5{margin-left:71.42857142857142%}.cal-row-fluid .cal-offset4,.cal-row-fluid .cal-offset4:first-child,.cal-week-box .cal-offset4{margin-left:57.14285714285714%}.cal-row-fluid .cal-offset3,.cal-row-fluid .cal-offset3:first-child,.cal-week-box .cal-offset3{margin-left:42.857142857142854%}.cal-row-fluid .cal-offset2,.cal-row-fluid .cal-offset2:first-child,.cal-week-box .cal-offset2{margin-left:28.57142857142857%}.cal-row-fluid .cal-offset1,.cal-row-fluid .cal-offset1:first-child,.cal-week-box .cal-offset1{margin-left:14.285714285714285%}.cal-row-fluid .cal-cell1{width:14.285714285714285%}.cal-row-fluid [class*=cal-cell].hide,[class*=cal-cell].hide{display:none}.cal-row-fluid [class*=cal-cell].pull-right,[class*=cal-cell].pull-right{float:right}.cal-row-head [class*=cal-cell],.cal-row-head [class*=cal-cell]:first-child{min-height:auto;overflow:hidden;text-overflow:ellipsis}.cal-events-num{margin-top:20px}.cal-month-day{position:relative;display:block;width:100%}#cal-week-box{position:absolute;width:70px;left:-71px;top:-1px;padding:8px 5px;cursor:pointer}#cal-day-tick{position:absolute;right:50%;bottom:-21px;padding:0 5px;cursor:pointer;z-index:5;width:26px;margin-right:-17px}.cal-year-box #cal-day-tick{margin-right:-7px}#cal-slide-box{position:relative}#cal-slide-tick{position:absolute;width:16px;margin-left:-7px;height:9px;top:-1px;z-index:1}#cal-slide-tick.tick-month1{left:12.5%}#cal-slide-tick.tick-month2{left:37.5%}#cal-slide-tick.tick-month3{left:62.5%}#cal-slide-tick.tick-month4{left:87.5%}#cal-slide-tick.tick-day1{left:7.14285714285715%}#cal-slide-tick.tick-day2{left:21.42857142857143%}#cal-slide-tick.tick-day3{left:35.71428571428572%}#cal-slide-tick.tick-day4{left:50%}#cal-slide-tick.tick-day5{left:64.2857142857143%}#cal-slide-tick.tick-day6{left:78.57142857142859%}#cal-slide-tick.tick-day7{left:92.85714285714285%}.events-list{position:absolute;bottom:0;left:0;overflow:hidden}#cal-slide-content ul.unstyled{margin-bottom:0}.cal-week-box{position:relative}.cal-week-box [data-event-class]{white-space:nowrap;height:30px;margin:1px;line-height:30px;text-overflow:ellipsis;overflow:hidden;padding-left:10px}.cal-week-box .cal-column{position:absolute;height:100%;z-index:-1}.cal-week-box .arrow-after,.cal-week-box .arrow-before{position:relative}.cal-week-box .arrow-after:after{content:"";position:absolute;top:0;width:0;height:0;right:0;border-top:15px solid #fff;border-left:8px solid;border-bottom:15px solid #FFF}.cal-week-box .arrow-before:before{content:"";position:absolute;top:0;width:0;height:0;left:1px;border-top:15px solid transparent;border-left:8px solid #FFF;border-bottom:15px solid transparent}#cal-day-box{text-wrap:none}#cal-day-box .cal-day-hour-part{height:30px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border-bottom:thin dashed #e1e1e1}#cal-day-box .cal-day-hour .day-highlight{height:30px}#cal-day-box .cal-hours{font-weight:bolder}#cal-day-box .cal-day-hour:nth-child(odd){background-color:#fafafa}#cal-day-box #cal-day-panel{position:relative;padding-left:60px}#cal-day-box #cal-day-panel-hour{position:absolute;width:100%;margin-left:-60px}#cal-day-box .day-event{position:relative;max-width:200px;overflow:hidden}#cal-day-box .day-highlight{line-height:30px;padding-left:8px;padding-right:8px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid #c3c3c3;margin:1px;overflow:hidden;text-overflow:ellipsis}#cal-day-box .day-highlight.dh-event-important{border:1px solid #ad2121}#cal-day-box .day-highlight.dh-event-warning{border:1px solid #e3bc08}#cal-day-box .day-highlight.dh-event-info{border:1px solid #1e90ff}#cal-day-box .day-highlight.dh-event-inverse{border:1px solid #1b1b1b}#cal-day-box .day-highlight.dh-event-success{border:1px solid #006400}#cal-day-box .day-highlight.dh-event-special{background-color:#ffe6ff;border:1px solid purple}.event{display:block;background-color:#c3c3c3;width:12px;height:12px;margin-right:2px;margin-bottom:2px;-webkit-box-shadow:inset 0 0 5px 0 rgba(0,0,0,.4);box-shadow:inset 0 0 5px 0 rgba(0,0,0,.4);border-radius:8px;border:1px solid #fff}.event-block{display:block;background-color:#c3c3c3;width:20px;height:100%}.cal-event-list .event.pull-left{margin-top:3px}.event-important{background-color:#ad2121}.event-info{background-color:#1e90ff}.event-warning{background-color:#e3bc08}.event-inverse{background-color:#1b1b1b}.event-success{background-color:#006400}.event-special{background-color:purple}.day-highlight,.day-highlight:hover{background-color:#ddd}.day-highlight.dh-event-important,.day-highlight.dh-event-important:hover{background-color:#fae3e3}.day-highlight.dh-event-warning,.day-highlight.dh-event-warning:hover{background-color:#fdf1ba}.day-highlight.dh-event-info,.day-highlight.dh-event-info:hover{background-color:#d1e8ff}.day-highlight.dh-event-inverse,.day-highlight.dh-event-inverse:hover{background-color:#c1c1c1}.day-highlight.dh-event-success,.day-highlight.dh-event-success:hover{background-color:#caffca}.day-highlight.dh-event-special,.day-highlight.dh-event-special:hover{background-color:#ffe6ff}.cal-row-head [class*=cal-cell],.cal-row-head [class*=cal-cell]:first-child{font-weight:bolder;text-align:center;border:0 solid;padding:5px 0}.cal-row-head [class*=cal-cell] small{font-weight:400}.cal-row-fluid:hover,.cal-year-box .row-fluid:hover{background-color:#fafafa}.cal-month-day{height:100px}[class*=cal-cell]:hover{background-color:#ededed}.cal-month-box [class*=cal-cell],.cal-year-box [class*=span]{min-height:100px;border-right:1px solid #e1e1e1;position:relative}.cal-year-box [class*=span]{min-height:60px}.cal-month-box .cal-row-fluid [class*=cal-cell]:last-child,.cal-year-box .row-fluid [class*=span]:last-child{border-right:0}.cal-month-box .cal-row-fluid,.cal-year-box .row-fluid{border-bottom:1px solid #e1e1e1;margin-left:0;margin-right:0}.cal-month-box .cal-row-fluid:last-child,.cal-year-box .row-fluid:last-child{border-bottom:0}.cal-month-box,.cal-week-box,.cal-year-box{border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;border-right:1px solid #e1e1e1;border-left:1px solid #e1e1e1;border-radius:2px}span[data-cal-date]{font-size:1.2em;font-weight:400;opacity:.5;cursor:pointer;transition:all .3s ease-in-out;-webkit-transition:all .1s ease-in-out;-moz-transition:all .1s ease-in-out;-ms-transition:all .1s ease-in-out;-o-transition:all .1s ease-in-out;margin-top:15px;margin-right:15px}span[data-cal-date]:hover{opacity:1}.cal-day-outmonth span[data-cal-date]{opacity:.1;cursor:default}.cal-day-today{background-color:#e8fde7}.cal-day-today span[data-cal-date]{color:#006400}.cal-month-box .cal-day-today span[data-cal-date]{font-size:1.9em}.cal-day-holiday span[data-cal-date]{color:purple}.cal-day-weekend span[data-cal-date]{color:#8b0000}#cal-week-box{border:1px solid #e1e1e1;border-right:0;border-radius:5px 0 0 5px;background-color:#fafafa;text-align:right}#cal-day-tick{border:1px solid #e1e1e1;border-top:0 solid;border-radius:0 0 5px 5px;background-color:#ededed;text-align:center}#cal-slide-box{border-top:0 solid #8c8c8c}#cal-slide-content{padding:20px;color:#fff;background-image:url(../img/dark_wood.png);-webkit-box-shadow:inset 0 0 15px 0 rgba(0,0,0,.5);box-shadow:inset 0 0 15px 0 rgba(0,0,0,.5)}#cal-slide-tick{background-image:url(../img/tick.png?2)}#cal-slide-content:hover{background-color:transparent}#cal-slide-content a.event-item{color:#fff;font-weight:400;line-height:22px}.events-list{max-height:47px;padding-left:5px}.cal-column{border-left:1px solid #e1e1e1}a.cal-event-week{text-decoration:none;color:#151515}.badge-important{background-color:#b94a48} +[class*="cal-cell"]{float:left;margin-left:0;min-height:1px}.cal-row-fluid{width:100%;*zoom:1}.cal-row-fluid:before,.cal-row-fluid:after{display:table;content:"";line-height:0}.cal-row-fluid:after{clear:both}.cal-row-fluid [class*="cal-cell"]{display:block;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:0;*margin-left:-0.05213764337851929%}.cal-row-fluid [class*="cal-cell"]:first-child{margin-left:0}.cal-row-fluid .controls-row [class*="cal-cell"]+[class*="cal-cell"]{margin-left:0}.cal-row-fluid .cal-cell7{width:100%;*width:99.94669509594883%}.cal-row-fluid .cal-cell6{width:85.71428571428571%;*width:85.66098081023453%}.cal-row-fluid .cal-cell5{width:71.42857142857142%;*width:71.37526652452024%}.cal-row-fluid .cal-cell4{width:57.14285714285714%;*width:57.089552238805965%}.cal-row-fluid .cal-cell3{width:42.857142857142854%;*width:42.80383795309168%}.cal-row-fluid .cal-cell2{width:28.57142857142857%;*width:28.518123667377395%}.cal-row-fluid .cal-cell1{width:14.285714285714285%;*width:14.232409381663112%}.cal-week-box .cal-offset7,.cal-row-fluid .cal-offset7,.cal-row-fluid .cal-offset7:first-child{margin-left:100%;*margin-left:99.89339019189765%}.cal-week-box .cal-offset6,.cal-row-fluid .cal-offset6,.cal-row-fluid .cal-offset6:first-child{margin-left:85.71428571428571%;*margin-left:85.60767590618336%}.cal-week-box .cal-offset5,.cal-row-fluid .cal-offset5,.cal-row-fluid .cal-offset5:first-child{margin-left:71.42857142857142%;*margin-left:71.32196162046907%}.cal-week-box .cal-offset4,.cal-row-fluid .cal-offset4,.cal-row-fluid .cal-offset4:first-child{margin-left:57.14285714285714%;*margin-left:57.03624733475479%}.cal-week-box .cal-offset3,.cal-row-fluid .cal-offset3,.cal-row-fluid .cal-offset3:first-child{margin-left:42.857142857142854%;*margin-left:42.750533049040506%}.cal-week-box .cal-offset2,.cal-row-fluid .cal-offset2,.cal-row-fluid .cal-offset2:first-child{margin-left:28.57142857142857%;*margin-left:28.46481876332622%}.cal-week-box .cal-offset1,.cal-row-fluid .cal-offset1,.cal-row-fluid .cal-offset1:first-child{margin-left:14.285714285714285%;*margin-left:14.17910447761194%}.cal-row-fluid .cal-cell1{width:14.285714285714285%;*width:14.233576642335766%}[class*="cal-cell"].hide,.cal-row-fluid [class*="cal-cell"].hide{display:none}[class*="cal-cell"].pull-right,.cal-row-fluid [class*="cal-cell"].pull-right{float:right}.cal-row-head [class*="cal-cell"]:first-child,.cal-row-head [class*="cal-cell"]{min-height:auto;overflow:hidden;text-overflow:ellipsis}.cal-events-num{margin-top:20px}.cal-month-day{position:relative;display:block;width:100%}#cal-week-box{position:absolute;width:70px;left:-71px;top:-1px;padding:8px 5px;cursor:pointer}#cal-day-tick{position:absolute;right:50%;bottom:-21px;padding:0 5px;cursor:pointer;z-index:5;text-align:center;width:26px;margin-right:-17px}.cal-year-box #cal-day-tick{margin-right:-7px}#cal-slide-box{position:relative}#cal-slide-tick{position:absolute;width:16px;margin-left:-7px;height:9px;top:-1px;z-index:1}#cal-slide-tick.tick-month1{left:12.5%}#cal-slide-tick.tick-month2{left:37.5%}#cal-slide-tick.tick-month3{left:62.5%}#cal-slide-tick.tick-month4{left:87.5%}#cal-slide-tick.tick-day1{left:7.14285714285715%}#cal-slide-tick.tick-day2{left:21.42857142857143%}#cal-slide-tick.tick-day3{left:35.71428571428572%}#cal-slide-tick.tick-day4{left:50%}#cal-slide-tick.tick-day5{left:64.2857142857143%}#cal-slide-tick.tick-day6{left:78.57142857142859%}#cal-slide-tick.tick-day7{left:92.85714285714285%}.events-list{position:absolute;bottom:0;left:0;overflow:hidden}#cal-slide-content ul.unstyled{margin-bottom:0}.cal-week-box{position:relative}.cal-week-box [data-event-class]{white-space:nowrap;height:30px;margin:1px 1px;line-height:30px;text-overflow:ellipsis;overflow:hidden;padding-left:10px}.cal-week-box .cal-column{position:absolute;height:100%;z-index:-1}.cal-week-box .arrow-before,.cal-week-box .arrow-after{position:relative}.cal-week-box .arrow-after:after{content:"";position:absolute;top:0;width:0;height:0;right:0;border-top:15px solid #fff;border-left:8px solid;border-bottom:15px solid #fff}.cal-week-box .arrow-before:before{content:"";position:absolute;top:0;width:0;height:0;left:1px;border-top:15px solid transparent;border-left:8px solid #fff;border-bottom:15px solid transparent}#cal-day-box{text-wrap:none}#cal-day-box .cal-day-hour-part{height:30px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border-bottom:thin dashed #e1e1e1}#cal-day-box .cal-day-hour .day-highlight{height:30px}#cal-day-box .cal-hours{font-weight:bolder}#cal-day-box .cal-day-hour:nth-child(odd){background-color:#fafafa}#cal-day-box #cal-day-panel{position:relative;padding-left:60px}#cal-day-box #cal-day-panel-hour{position:absolute;width:100%;margin-left:-60px}#cal-day-box .day-event{position:relative;max-width:200px;overflow:hidden}#cal-day-box .day-highlight{line-height:30px;padding-left:8px;padding-right:8px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid #c3c3c3;margin:1px 1px;overflow:hidden;text-overflow:ellipsis}#cal-day-box .day-highlight.dh-event-important{border:1px solid #ad2121}#cal-day-box .day-highlight.dh-event-warning{border:1px solid #e3bc08}#cal-day-box .day-highlight.dh-event-info{border:1px solid #1e90ff}#cal-day-box .day-highlight.dh-event-inverse{border:1px solid #1b1b1b}#cal-day-box .day-highlight.dh-event-success{border:1px solid #006400}#cal-day-box .day-highlight.dh-event-special{background-color:#ffe6ff;border:1px solid #800080}.event{display:block;background-color:#c3c3c3;width:12px;height:12px;margin-right:2px;margin-bottom:2px;-webkit-box-shadow:inset 0 0 5px 0 rgba(0,0,0,0.4);box-shadow:inset 0 0 5px 0 rgba(0,0,0,0.4);border-radius:8px;border:1px solid #fff}.event-block{display:block;background-color:#c3c3c3;width:20px;height:100%}.cal-event-list .event.pull-left{margin-top:3px}.event-important{background-color:#ad2121}.event-info{background-color:#1e90ff}.event-warning{background-color:#e3bc08}.event-inverse{background-color:#1b1b1b}.event-success{background-color:#006400}.event-special{background-color:#800080}.day-highlight:hover,.day-highlight{background-color:#ddd}.day-highlight.dh-event-important:hover,.day-highlight.dh-event-important{background-color:#fae3e3}.day-highlight.dh-event-warning:hover,.day-highlight.dh-event-warning{background-color:#fdf1ba}.day-highlight.dh-event-info:hover,.day-highlight.dh-event-info{background-color:#d1e8ff}.day-highlight.dh-event-inverse:hover,.day-highlight.dh-event-inverse{background-color:#c1c1c1}.day-highlight.dh-event-success:hover,.day-highlight.dh-event-success{background-color:#caffca}.day-highlight.dh-event-special:hover,.day-highlight.dh-event-special{background-color:#ffe6ff}.cal-row-head [class*="cal-cell"]:first-child,.cal-row-head [class*="cal-cell"]{font-weight:bolder;text-align:center;border:0 solid;padding:5px 0}.cal-row-head [class*="cal-cell"] small{font-weight:normal}.cal-year-box .row-fluid:hover,.cal-row-fluid:hover{background-color:#fafafa}.cal-month-day{height:100px}[class*="cal-cell"]:hover{background-color:#ededed}.cal-year-box [class*="span"],.cal-month-box [class*="cal-cell"]{min-height:100px;border-right:1px solid #e1e1e1;position:relative}.cal-year-box [class*="span"]{min-height:60px}.cal-year-box .row-fluid [class*="span"]:last-child,.cal-month-box .cal-row-fluid [class*="cal-cell"]:last-child{border-right:0}.cal-year-box .row-fluid,.cal-month-box .cal-row-fluid{border-bottom:1px solid #e1e1e1;margin-left:0;margin-right:0}.cal-year-box .row-fluid:last-child,.cal-month-box .cal-row-fluid:last-child{border-bottom:0}.cal-month-box,.cal-year-box,.cal-week-box{border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;border-right:1px solid #e1e1e1;border-left:1px solid #e1e1e1;border-radius:2px}span[data-cal-date]{font-size:1.2em;font-weight:normal;opacity:.5;cursor:pointer;transition:all .3s ease-in-out;-webkit-transition:all .1s ease-in-out;-moz-transition:all .1s ease-in-out;-ms-transition:all .1s ease-in-out;-o-transition:all .1s ease-in-out;margin-top:15px;margin-right:15px}span[data-cal-date]:hover{opacity:1}.cal-day-outmonth span[data-cal-date]{opacity:.1;cursor:default}.cal-day-today{background-color:#e8fde7}.cal-day-today span[data-cal-date]{color:darkgreen}.cal-month-box .cal-day-today span[data-cal-date]{font-size:1.9em}.cal-day-holiday span[data-cal-date]{color:#800080}.cal-day-weekend span[data-cal-date]{color:darkred}#cal-week-box{border:1px solid #e1e1e1;border-right:0;border-radius:5px 0 0 5px;background-color:#fafafa;text-align:right}#cal-day-tick{border:1px solid #e1e1e1;border-top:0 solid;border-radius:0 0 5px 5px;background-color:#ededed;text-align:center}#cal-slide-box{border-top:0 solid #8c8c8c}#cal-slide-content{padding:20px;color:#fff;background-image:url("../img/dark_wood.png");-webkit-box-shadow:inset 0 0 15px 0 rgba(0,0,0,0.5);box-shadow:inset 0 0 15px 0 rgba(0,0,0,0.5)}#cal-slide-tick{background-image:url("../img/tick.png?2")}#cal-slide-content:hover{background-color:transparent}#cal-slide-content a.event-item{color:#fff;font-weight:normal;line-height:22px}.events-list{max-height:47px;padding-left:5px}.cal-column{border-left:1px solid #e1e1e1}a.cal-event-week{text-decoration:none;color:#151515}.badge-important{background-color:#b94a48} \ No newline at end of file diff --git a/js/calendar.min.js b/js/calendar.min.js index 5cc2175b..2665ac3a 100644 --- a/js/calendar.min.js +++ b/js/calendar.min.js @@ -1,2 +1,2 @@ -/*! bootstrap-calendar - v0.2.4 - 2015-04-13 - https://github.com/Serhioromano/bootstrap-calendar */ -"use strict";Date.prototype.getWeek=function(){var a=new Date(this.getFullYear(),0,1);return Math.ceil(((this.getTime()-a.getTime())/864e5+a.getDay()+1)/7)},Date.prototype.getMonthFormatted=function(){var a=this.getMonth()+1;return 10>a?"0"+a:a},Date.prototype.getDateFormatted=function(){var a=this.getDate();return 10>a?"0"+a:a},String.prototype.format||(String.prototype.format=function(){var a=arguments;return this.replace(/{(\d+)}/g,function(b,c){return"undefined"!=typeof a[c]?a[c]:b})}),String.prototype.formatNum||(String.prototype.formatNum=function(a){for(var b=""+this;b.length"),function(a,c){var j,k=null;if(j=/^(\d\d)-(\d\d)$/.exec(c))k=new Date(f,parseInt(j[2],10)-1,parseInt(j[1],10));else if(j=/^(\d\d)-(\d\d)-(\d\d\d\d)$/.exec(c))parseInt(j[3],10)==f&&(k=new Date(f,parseInt(j[2],10)-1,parseInt(j[1],10)));else if(j=/^easter(([+\-])(\d+))?$/.exec(c))k=h(f,j[1]?parseInt(j[1],10):0);else if(j=/^(\d\d)([+\-])([1-5])\*([0-6])$/.exec(c)){var l=parseInt(j[1],10)-1,m=j[2],n=parseInt(j[3]),o=parseInt(j[4]);switch(m){case"+":for(var p=new Date(f,l,-6);p.getDay()!=o;)p=new Date(p.getFullYear(),p.getMonth(),p.getDate()+1);k=new Date(p.getFullYear(),p.getMonth(),p.getDate()+7*n);break;case"-":for(var p=new Date(f,l+1,7);p.getDay()!=o;)p=new Date(p.getFullYear(),p.getMonth(),p.getDate()-1);k=new Date(p.getFullYear(),p.getMonth(),p.getDate()-7*n)}}if(!k)return e("Unknown holiday: "+b),i=!0,!1;switch(a){case 0:d=k;break;case 1:if(k.getTime()<=d.getTime())return e("Unknown holiday: "+b),i=!0,!1;g=k;break;default:return e("Unknown holiday: "+b),i=!0,!1}}),!i){var j=[];if(g)for(var l=new Date(d.getTime());l.getTime()<=g.getTime();l.setDate(l.getDate()+1))j.push(new Date(l.getTime()));else j.push(d);k.push({name:c,days:j})}}),d.cache[g]=k,d.cache[g]}function e(b){"object"==a.type(window.console)&&"function"==a.type(window.console.warn)&&window.console.warn("[Bootstrap-Calendar] "+b)}function f(b,c){return this.options=a.extend(!0,{position:{start:new Date,end:new Date}},i,b),this.setLanguage(this.options.language),this.context=c,c.css("width",this.options.width).addClass("cal-context"),this.view(),this}function g(b,c,d,e){b.stopPropagation();var c=a(c),f=c.closest(".cal-cell"),g=f.closest(".cal-before-eventlist"),h=f.data("cal-row");c.fadeOut("fast"),d.slideUp("fast",function(){var b=a(".events-list",f);d.html(e.options.templates["events-list"]({cal:e,events:e.getEventsBetween(parseInt(b.data("cal-start")),parseInt(b.data("cal-end")))})),g.after(d),e.activecell=a("[data-cal-date]",f).text(),a("#cal-slide-tick").addClass("tick"+h).show(),d.slideDown("fast",function(){a("body").one("click",function(){d.slideUp("fast"),e.activecell=0})})}),setTimeout(function(){a("a.event-item").mouseenter(function(){a('a[data-event-id="'+a(this).data("event-id")+'"]').closest(".cal-cell1").addClass("day-highlight dh-"+a(this).data("event-class"))}),a("a.event-item").mouseleave(function(){a("div.cal-cell1").removeClass("day-highlight dh-"+a(this).data("event-class"))}),e._update_modal()},400)}function h(a,b){var c=a%19,d=Math.floor(a/100),e=a%100,f=Math.floor(d/4),g=d%4,h=Math.floor((d+8)/25),i=Math.floor((d-h+1)/3),j=(19*c+d-f-i+15)%30,k=Math.floor(e/4),l=e%4,m=(32+2*g+2*k-j-l)%7,n=Math.floor((c+11*j+22*m)/451),o=j+m+7*n+114,p=Math.floor(o/31)-1,q=o%31+1;return new Date(a,p,q+(b?b:0),0,0,0)}var i={width:"100%",view:"month",day:"now",time_start:"06:00",time_end:"22:00",time_split:"30",events_source:"",tmpl_path:"tmpls/",tmpl_cache:!0,classes:{months:{inmonth:"cal-day-inmonth",outmonth:"cal-day-outmonth",saturday:"cal-day-weekend",sunday:"cal-day-weekend",holidays:"cal-day-holiday",today:"cal-day-today"},week:{workday:"cal-day-workday",saturday:"cal-day-weekend",sunday:"cal-day-weekend",holidays:"cal-day-holiday",today:"cal-day-today"}},modal:null,modal_type:"iframe",modal_title:null,views:{year:{slide_events:1,enable:1},month:{slide_events:1,enable:1},week:{enable:1},day:{enable:1}},merge_holidays:!1,onAfterEventsLoad:function(a){},onBeforeEventsLoad:function(a){a()},onAfterViewLoad:function(a){},onAfterModalShown:function(a){},onAfterModalHidden:function(a){},events:[],templates:{year:"",month:"",week:"",day:""},stop_cycling:!1},j={first_day:2,holidays:{"01-01":"New Year's Day","01+3*1":"Birthday of Dr. Martin Luther King, Jr.","02+3*1":"Washington's Birthday","05-1*1":"Memorial Day","04-07":"Independence Day","09+1*1":"Labor Day","10+2*1":"Columbus Day","11-11":"Veterans Day","11+4*4":"Thanksgiving Day","25-12":"Christmas"}},k={error_noview:"Calendar: View {0} not found",error_dateformat:'Calendar: Wrong date format {0}. Should be either "now" or "yyyy-mm-dd"',error_loadurl:"Calendar: Event URL is not set",error_where:'Calendar: Wrong navigation direction {0}. Can be only "next" or "prev" or "today"',error_timedevide:"Calendar: Time split parameter should divide 60 without decimals. Something like 10, 15, 30",no_events_in_day:"No events in this day.",title_year:"{0}",title_month:"{0} {1}",title_week:"week {0} of {1}",title_day:"{0} {1} {2}, {3}",week:"Week {0}",all_day:"All day",time:"Time",events:"Events",before_time:"Ends before timeline",after_time:"Starts after timeline",m0:"January",m1:"February",m2:"March",m3:"April",m4:"May",m5:"June",m6:"July",m7:"August",m8:"September",m9:"October",m10:"November",m11:"December",ms0:"Jan",ms1:"Feb",ms2:"Mar",ms3:"Apr",ms4:"May",ms5:"Jun",ms6:"Jul",ms7:"Aug",ms8:"Sep",ms9:"Oct",ms10:"Nov",ms11:"Dec",d0:"Sunday",d1:"Monday",d2:"Tuesday",d3:"Wednesday",d4:"Thursday",d5:"Friday",d6:"Saturday"},l="";try{"object"==a.type(window.jstz)&&"function"==a.type(jstz.determine)&&(l=jstz.determine().name(),"string"!==a.type(l)&&(l=""))}catch(m){}d.cache={},f.prototype.setOptions=function(b){a.extend(this.options,b),"language"in b&&this.setLanguage(b.language),"modal"in b&&this._update_modal()},f.prototype.setLanguage=function(b){window.calendar_languages&&b in window.calendar_languages?(this.locale=a.extend(!0,{},k,calendar_languages[b]),this.options.language=b):(this.locale=k,delete this.options.language)},f.prototype._render=function(){this.context.html(""),this._loadTemplate(this.options.view),this.stop_cycling=!1;var a={};a.cal=this,a.day=1,a.days_name=1==c(this,"first_day")?[this.locale.d1,this.locale.d2,this.locale.d3,this.locale.d4,this.locale.d5,this.locale.d6,this.locale.d0]:[this.locale.d0,this.locale.d1,this.locale.d2,this.locale.d3,this.locale.d4,this.locale.d5,this.locale.d6];var b=parseInt(this.options.position.start.getTime()),d=parseInt(this.options.position.end.getTime());switch(a.events=this.getEventsBetween(b,d),this.options.view){case"month":break;case"week":this._calculate_hour_minutes(a);break;case"day":this._calculate_hour_minutes(a)}a.start=new Date(this.options.position.start.getTime()),a.lang=this.locale,this.context.append(this.options.templates[this.options.view](a)),this._update()},f.prototype._calculate_hour_minutes=function(b){var c=this,d=parseInt(this.options.time_split),f=60/d,g=Math.min(f,1);(f>=1&&f%1!=0||1>f&&1440/d%1!=0)&&a.error(this.locale.error_timedevide);var h=this.options.time_start.split(":"),i=this.options.time_end.split(":");b.hours=(parseInt(i[0])-parseInt(h[0]))*g;var j=b.hours*f-parseInt(h[1])/d,k=6e4*d,l=new Date(this.options.position.start.getTime());l.setHours(h[0]),l.setMinutes(h[1]);var m=new Date(this.options.position.end.getTime());m.setHours(i[0]),m.setMinutes(i[1]),b.all_day=[],b.by_hour=[],b.after_time=[],b.before_time=[],a.each(b.events,function(a,d){var f=new Date(parseInt(d.start)),g=new Date(parseInt(d.end));if(d.start_hour=f.getHours().toString().formatNum(2)+":"+f.getMinutes().toString().formatNum(2),d.end_hour=g.getHours().toString().formatNum(2)+":"+g.getMinutes().toString().formatNum(2),d.startm.getTime()&&(e(1),d.end_hour=g.getDate()+" "+c.locale["ms"+g.getMonth()]+" "+d.end_hour),d.startm.getTime())return void b.all_day.push(d);if(d.endm.getTime())return void b.after_time.push(d);var h=l.getTime()-d.start;d.top=h>=0?0:Math.abs(h)/k;var i=Math.abs(j-d.top),n=(d.end-d.start)/k;h>=0&&(n=(d.end-l.getTime())/k),d.lines=n,n>i&&(d.lines=i),b.by_hour.push(d)})},f.prototype._hour_min=function(a){var b=this.options.time_start.split(":"),c=parseInt(this.options.time_split),d=60/c;return 0==a?d-parseInt(b[1])/c:d},f.prototype._hour=function(a,b){var c=this.options.time_start.split(":"),d=parseInt(this.options.time_split),e=""+(parseInt(c[0])+a*Math.max(d/60,1)),f=""+(d*b+(0==a?parseInt(c[1]):0));return e.formatNum(2)+":"+f.formatNum(2)},f.prototype._week=function(b){this._loadTemplate("week-days");var d={},e=parseInt(this.options.position.start.getTime()),f=parseInt(this.options.position.end.getTime()),g=[],h=this,i=c(this,"first_day");return a.each(this.getEventsBetween(e,f),function(a,b){b.start_day=new Date(parseInt(b.start)).getDay(),1==i&&(b.start_day=(b.start_day+6)%7),b.days=b.end-b.start<=864e5?1:(b.end-b.start)/864e5,b.start7&&(b.days=7-b.start_day),g.push(b)}),d.events=g,d.cal=this,h.options.templates["week-days"](d)},f.prototype._month=function(a){this._loadTemplate("year-month");var b={cal:this},c=a+1;b.data_day=this.options.position.start.getFullYear()+"-"+(10>c?"0"+c:c)+"-01",b.month_name=this.locale["m"+a];var d=new Date(this.options.position.start.getFullYear(),a,1,0,0,0);return b.start=parseInt(d.getTime()),b.end=parseInt(new Date(this.options.position.start.getFullYear(),a+1,1,0,0,0).getTime()),b.events=this.getEventsBetween(b.start,b.end),this.options.templates["year-month"](b)},f.prototype._day=function(b,d){this._loadTemplate("month-day");var e={tooltip:"",cal:this},f=this.options.classes.months.outmonth,g=this.options.position.start.getDay();2==c(this,"first_day")?g++:g=0==g?7:g,d=d-g+1;var h=new Date(this.options.position.start.getFullYear(),this.options.position.start.getMonth(),d,0,0,0);d>0&&(f=this.options.classes.months.inmonth);var i=new Date(this.options.position.end.getTime()-1).getDate();if(d+1>i&&(this.stop_cycling=!0),d>i&&(d-=i,f=this.options.classes.months.outmonth),f=a.trim(f+" "+this._getDayClass("months",h)),0>=d){var j=new Date(this.options.position.start.getFullYear(),this.options.position.start.getMonth(),0).getDate();d=j-Math.abs(d),f+=" cal-month-first-row"}var k=this._getHoliday(h);return k!==!1&&(e.tooltip=k),e.data_day=h.getFullYear()+"-"+h.getMonthFormatted()+"-"+(10>d?"0"+d:d),e.cls=f,e.day=d,e.start=parseInt(h.getTime()),e.end=parseInt(e.start+864e5),e.events=this.getEventsBetween(e.start,e.end),this.options.templates["month-day"](e)},f.prototype._getHoliday=function(b){var c=!1;return a.each(d(this,b.getFullYear()),function(){var d=!1;return a.each(this.days,function(){return this.toDateString()==b.toDateString()?(d=!0,!1):void 0}),d?(c=this.name,!1):void 0}),c},f.prototype._getHolidayName=function(a){var b=this._getHoliday(a);return b===!1?"":b},f.prototype._getDayClass=function(a,b){var c=this,d=function(b,d){var e;e=c.options.classes&&a in c.options.classes&&b in c.options.classes[a]?c.options.classes[a][b]:"","string"==typeof e&&e.length&&d.push(e)},e=[];b.toDateString()==(new Date).toDateString()&&d("today",e);var f=this._getHoliday(b);switch(f!==!1&&d("holidays",e),b.getDay()){case 0:d("sunday",e);break;case 6:d("saturday",e)}return d(b.toDateString(),e),e.join(" ")},f.prototype.view=function(a){if(a){if(!this.options.views[a].enable)return;this.options.view=a}this._init_position(),this._loadEvents(),this._render(),this.options.onAfterViewLoad.call(this,this.options.view)},f.prototype.navigate=function(b,c){var d=a.extend({},this.options.position);if("next"==b)switch(this.options.view){case"year":d.start.setFullYear(this.options.position.start.getFullYear()+1);break;case"month":d.start.setMonth(this.options.position.start.getMonth()+1);break;case"week":d.start.setDate(this.options.position.start.getDate()+7);break;case"day":d.start.setDate(this.options.position.start.getDate()+1)}else if("prev"==b)switch(this.options.view){case"year":d.start.setFullYear(this.options.position.start.getFullYear()-1);break;case"month":d.start.setMonth(this.options.position.start.getMonth()-1);break;case"week":d.start.setDate(this.options.position.start.getDate()-7);break;case"day":d.start.setDate(this.options.position.start.getDate()-1)}else"today"==b?d.start.setTime((new Date).getTime()):a.error(this.locale.error_where.format(b));this.options.day=d.start.getFullYear()+"-"+d.start.getMonthFormatted()+"-"+d.start.getDateFormatted(),this.view(),_.isFunction(c)&&c()},f.prototype._init_position=function(){var b,d,e;if("now"==this.options.day){var f=new Date;b=f.getFullYear(),d=f.getMonth(),e=f.getDate()}else if(this.options.day.match(/^\d{4}-\d{2}-\d{2}$/g)){var g=this.options.day.split("-");b=parseInt(g[0],10),d=parseInt(g[1],10)-1,e=parseInt(g[2],10)}else a.error(this.locale.error_dateformat.format(this.options.day));switch(this.options.view){case"year":this.options.position.start.setTime(new Date(b,0,1).getTime()),this.options.position.end.setTime(new Date(b+1,0,1).getTime());break;case"month":this.options.position.start.setTime(new Date(b,d,1).getTime()),this.options.position.end.setTime(new Date(b,d+1,1).getTime());break;case"day":this.options.position.start.setTime(new Date(b,d,e).getTime()),this.options.position.end.setTime(new Date(b,d,e+1).getTime());break;case"week":var h,i=new Date(b,d,e);h=1==c(this,"first_day")?i.getDate()-(i.getDay()+6)%7:i.getDate()-i.getDay(),this.options.position.start.setTime(new Date(b,d,h).getTime()),this.options.position.end.setTime(new Date(b,d,h+7).getTime());break;default:a.error(this.locale.error_noview.format(this.options.view))}return this},f.prototype.getTitle=function(){var a=this.options.position.start;switch(this.options.view){case"year":return this.locale.title_year.format(a.getFullYear());case"month":return this.locale.title_month.format(this.locale["m"+a.getMonth()],a.getFullYear());case"week":return this.locale.title_week.format(a.getWeek(),a.getFullYear());case"day":return this.locale.title_day.format(this.locale["d"+a.getDay()],a.getDate(),this.locale["m"+a.getMonth()],a.getFullYear())}},f.prototype.isToday=function(){var a=(new Date).getTime();return a>this.options.position.start&&ag?"0"+g:g,c.html(b.locale.week.format(e.getWeek())),c.attr("data-cal-week",d+g).show().appendTo(f)}).on("mouseleave",function(){c.hide()}),c.click(function(){b.options.day=a(this).data("cal-week"),b.view("week")}),a("a.event").mouseenter(function(){a('a[data-event-id="'+a(this).data("event-id")+'"]').closest(".cal-cell1").addClass("day-highlight dh-"+a(this).data("event-class"))}),a("a.event").mouseleave(function(){a("div.cal-cell1").removeClass("day-highlight dh-"+a(this).data("event-class"))})},f.prototype._update_month_year=function(){if(this.options.views[this.options.view].slide_events){var b=this,c=a(document.createElement("div")).attr("id","cal-day-tick").html('');a(".cal-month-day, .cal-year-box .span3").on("mouseenter",function(){0!=a(".events-list",this).length&&a(this).children("[data-cal-date]").text()!=b.activecell&&c.show().appendTo(this)}).on("mouseleave",function(){c.hide()}).on("click",function(e){0!=a(".events-list",this).length&&a(this).children("[data-cal-date]").text()!=b.activecell&&g(e,c,d,b)});var d=a(document.createElement("div")).attr("id","cal-slide-box");d.hide().click(function(a){a.stopPropagation()}),this._loadTemplate("events-list"),c.click(function(c){g(c,a(this),d,b)})}},f.prototype.getEventsBetween=function(b,c){var d=[];return a.each(this.options.events,function(){if(null==this.start)return!0;var a=this.end||this.start;parseInt(this.start)=b&&d.push(this)}),d},a.fn.calendar=function(a){return new f(a,this)}}(jQuery); \ No newline at end of file +/*! bootstrap-calendar - v0.2.4 - 2016-05-01 - https://github.com/Serhioromano/bootstrap-calendar */ +"use strict";Date.prototype.getWeek=function(t){if(t){var e=new Date(this.valueOf()),a=(this.getDay()+6)%7;e.setDate(e.getDate()-a+3);var o=e.valueOf();return e.setMonth(0,1),4!=e.getDay()&&e.setMonth(0,1+(4-e.getDay()+7)%7),1+Math.ceil((o-e)/6048e5)}var i=new Date(this.getFullYear(),0,1);return Math.ceil(((this.getTime()-i.getTime())/864e5+i.getDay()+1)/7)},Date.prototype.getMonthFormatted=function(){var t=this.getMonth()+1;return 10>t?"0"+t:t},Date.prototype.getDateFormatted=function(){var t=this.getDate();return 10>t?"0"+t:t},String.prototype.format||(String.prototype.format=function(){var t=arguments;return this.replace(/{(\d+)}/g,function(e,a){return t[a]!==void 0?t[a]:e})}),String.prototype.formatNum||(String.prototype.formatNum=function(t){for(var e=""+this;t>e.length;)e="0"+e;return e}),function(t){function e(t,e){var a,o,i;i=t,a=0>t.indexOf("?")?"?":"&";for(o in e)i+=a+o+"="+encodeURIComponent(e[o]),a="&";return i}function a(e,a){var o=null!=e.options[a]?e.options[a]:null,i=null!=e.locale[a]?e.locale[a]:null;if("holidays"==a&&e.options.merge_holidays){var n={};return t.extend(!0,n,i?i:d.holidays),o&&t.extend(!0,n,o),n}return null!=o?o:null!=i?i:d[a]}function o(e,n){var s=[],l=a(e,"holidays");for(var d in l)s.push(d+":"+l[d]);if(s.push(n),s=s.join("|"),s in o.cache)return o.cache[s];var h=[];return t.each(l,function(e,a){var o=null,s=null,l=!1;if(t.each(e.split(">"),function(t,a){var d,h=null;if(d=/^(\d\d)-(\d\d)$/.exec(a))h=new Date(n,parseInt(d[2],10)-1,parseInt(d[1],10));else if(d=/^(\d\d)-(\d\d)-(\d\d\d\d)$/.exec(a))parseInt(d[3],10)==n&&(h=new Date(n,parseInt(d[2],10)-1,parseInt(d[1],10)));else if(d=/^easter(([+\-])(\d+))?$/.exec(a))h=r(n,d[1]?parseInt(d[1],10):0);else if(d=/^(\d\d)([+\-])([1-5])\*([0-6])$/.exec(a)){var p=parseInt(d[1],10)-1,c=d[2],u=parseInt(d[3]),m=parseInt(d[4]);switch(c){case"+":for(var f=new Date(n,p,-6);f.getDay()!=m;)f=new Date(f.getFullYear(),f.getMonth(),f.getDate()+1);h=new Date(f.getFullYear(),f.getMonth(),f.getDate()+7*u);break;case"-":for(var f=new Date(n,p+1,7);f.getDay()!=m;)f=new Date(f.getFullYear(),f.getMonth(),f.getDate()-1);h=new Date(f.getFullYear(),f.getMonth(),f.getDate()-7*u)}}if(!h)return i("Unknown holiday: "+e),l=!0,!1;switch(t){case 0:o=h;break;case 1:if(h.getTime()<=o.getTime())return i("Unknown holiday: "+e),l=!0,!1;s=h;break;default:return i("Unknown holiday: "+e),l=!0,!1}}),!l){var d=[];if(s)for(var p=new Date(o.getTime());p.getTime()<=s.getTime();p.setDate(p.getDate()+1))d.push(new Date(p.getTime()));else d.push(o);h.push({name:a,days:d})}}),o.cache[s]=h,o.cache[s]}function i(e){"object"==t.type(window.console)&&"function"==t.type(window.console.warn)&&window.console.warn("[Bootstrap-Calendar] "+e)}function n(e,a){return this.options=t.extend(!0,{position:{start:new Date,end:new Date}},l,e),this.setLanguage(this.options.language),this.context=a,a.css("width",this.options.width).addClass("cal-context"),this.view(),this}function s(e,a,o,i){e.stopPropagation();var a=t(a),n=a.closest(".cal-cell"),s=n.closest(".cal-before-eventlist"),r=n.data("cal-row");a.fadeOut("fast"),o.slideUp("fast",function(){var e=t(".events-list",n);o.html(i.options.templates["events-list"]({cal:i,events:i.getEventsBetween(parseInt(e.data("cal-start")),parseInt(e.data("cal-end")))})),s.after(o),i.activecell=t("[data-cal-date]",n).text(),t("#cal-slide-tick").addClass("tick"+r).show(),o.slideDown("fast",function(){t("body").one("click",function(){o.slideUp("fast"),i.activecell=0})})}),setTimeout(function(){t("a.event-item").mouseenter(function(){t('a[data-event-id="'+t(this).data("event-id")+'"]').closest(".cal-cell1").addClass("day-highlight dh-"+t(this).data("event-class"))}),t("a.event-item").mouseleave(function(){t("div.cal-cell1").removeClass("day-highlight dh-"+t(this).data("event-class"))}),i._update_modal()},400)}function r(t,e){var a=t%19,o=Math.floor(t/100),i=t%100,n=Math.floor(o/4),s=o%4,r=Math.floor((o+8)/25),l=Math.floor((o-r+1)/3),d=(19*a+o-n-l+15)%30,h=Math.floor(i/4),p=i%4,c=(32+2*s+2*h-d-p)%7,u=Math.floor((a+11*d+22*c)/451),m=d+c+7*u+114,f=Math.floor(m/31)-1,y=m%31+1;return new Date(t,f,y+(e?e:0),0,0,0)}var l={tooltip_container:"body",width:"100%",view:"month",day:"now",time_start:"06:00",time_end:"22:00",time_split:"30",events_source:"",events_cache:!1,format12:!1,am_suffix:"AM",pm_suffix:"PM",tmpl_path:"tmpls/",tmpl_cache:!0,classes:{months:{inmonth:"cal-day-inmonth",outmonth:"cal-day-outmonth",saturday:"cal-day-weekend",sunday:"cal-day-weekend",holidays:"cal-day-holiday",today:"cal-day-today"},week:{workday:"cal-day-workday",saturday:"cal-day-weekend",sunday:"cal-day-weekend",holidays:"cal-day-holiday",today:"cal-day-today"}},modal:null,modal_type:"iframe",modal_title:null,views:{year:{slide_events:1,enable:1},month:{slide_events:1,enable:1},week:{enable:1},day:{enable:1}},merge_holidays:!1,display_week_numbers:!0,weekbox:!0,onAfterEventsLoad:function(){},onBeforeEventsLoad:function(t){t()},onAfterViewLoad:function(){},onAfterModalShown:function(){},onAfterModalHidden:function(){},events:[],templates:{year:"",month:"",week:"",day:""},stop_cycling:!1},d={first_day:2,week_numbers_iso_8601:!1,holidays:{"01-01":"New Year's Day","01+3*1":"Birthday of Dr. Martin Luther King, Jr.","02+3*1":"Washington's Birthday","05-1*1":"Memorial Day","04-07":"Independence Day","09+1*1":"Labor Day","10+2*1":"Columbus Day","11-11":"Veterans Day","11+4*4":"Thanksgiving Day","25-12":"Christmas"}},h={error_noview:"Calendar: View {0} not found",error_dateformat:'Calendar: Wrong date format {0}. Should be either "now" or "yyyy-mm-dd"',error_loadurl:"Calendar: Event URL is not set",error_where:'Calendar: Wrong navigation direction {0}. Can be only "next" or "prev" or "today"',error_timedevide:"Calendar: Time split parameter should divide 60 without decimals. Something like 10, 15, 30",no_events_in_day:"No events in this day.",title_year:"{0}",title_month:"{0} {1}",title_week:"week {0} of {1}",title_day:"{0} {1} {2}, {3}",week:"Week {0}",all_day:"All day",time:"Time",events:"Events",before_time:"Ends before timeline",after_time:"Starts after timeline",m0:"January",m1:"February",m2:"March",m3:"April",m4:"May",m5:"June",m6:"July",m7:"August",m8:"September",m9:"October",m10:"November",m11:"December",ms0:"Jan",ms1:"Feb",ms2:"Mar",ms3:"Apr",ms4:"May",ms5:"Jun",ms6:"Jul",ms7:"Aug",ms8:"Sep",ms9:"Oct",ms10:"Nov",ms11:"Dec",d0:"Sunday",d1:"Monday",d2:"Tuesday",d3:"Wednesday",d4:"Thursday",d5:"Friday",d6:"Saturday"},p="";try{"object"==t.type(window.jstz)&&"function"==t.type(jstz.determine)&&(p=jstz.determine().name(),"string"!==t.type(p)&&(p=""))}catch(c){}o.cache={},n.prototype.setOptions=function(e){t.extend(this.options,e),"language"in e&&this.setLanguage(e.language),"modal"in e&&this._update_modal()},n.prototype.setLanguage=function(e){window.calendar_languages&&e in window.calendar_languages?(this.locale=t.extend(!0,{},h,calendar_languages[e]),this.options.language=e):(this.locale=h,delete this.options.language)},n.prototype._render=function(){this.context.html(""),this._loadTemplate(this.options.view),this.stop_cycling=!1;var t={};t.cal=this,t.day=1,t.days_name=1==a(this,"first_day")?[this.locale.d1,this.locale.d2,this.locale.d3,this.locale.d4,this.locale.d5,this.locale.d6,this.locale.d0]:[this.locale.d0,this.locale.d1,this.locale.d2,this.locale.d3,this.locale.d4,this.locale.d5,this.locale.d6];var e=parseInt(this.options.position.start.getTime()),o=parseInt(this.options.position.end.getTime());switch(t.events=this.getEventsBetween(e,o),this.options.view){case"month":break;case"week":this._calculate_hour_minutes(t);break;case"day":this._calculate_hour_minutes(t)}t.start=new Date(this.options.position.start.getTime()),t.lang=this.locale,this.context.append(this.options.templates[this.options.view](t)),this._update()},n.prototype._format_hour=function(t){var e=t.split(":"),a=parseInt(e[0]),o=parseInt(e[1]),i="";return this.options.format12&&(i=12>a?this.options.am_suffix:this.options.pm_suffix,a%=12,0==a&&(a=12)),(""+a).formatNum(2)+":"+(""+o).formatNum(2)+i},n.prototype._format_time=function(t){return this._format_hour(t.getHours()+":"+t.getMinutes())},n.prototype._calculate_hour_minutes=function(e){var a=this,o=parseInt(this.options.time_split),n=60/o,s=Math.min(n,1);(n>=1&&0!=n%1||1>n&&0!=1440/o%1)&&t.error(this.locale.error_timedevide);var r=this.options.time_start.split(":"),l=this.options.time_end.split(":");e.hours=(parseInt(l[0])-parseInt(r[0]))*s;var d=e.hours*n-parseInt(r[1])/o,h=6e4*o,p=new Date(this.options.position.start.getTime());p.setHours(r[0]),p.setMinutes(r[1]);var c=new Date(this.options.position.end.getTime());c.setHours(l[0]),c.setMinutes(l[1]),e.all_day=[],e.by_hour=[],e.after_time=[],e.before_time=[],t.each(e.events,function(t,o){var n=new Date(parseInt(o.start)),s=new Date(parseInt(o.end));if(o.start_hour=a._format_time(n),o.end_hour=a._format_time(s),o.startc.getTime()&&(i(1),o.end_hour=s.getDate()+" "+a.locale["ms"+s.getMonth()]+" "+o.end_hour),o.startc.getTime())return e.all_day.push(o),void 0;if(o.endc.getTime())return e.after_time.push(o),void 0;var r=p.getTime()-o.start;o.top=r>=0?0:Math.abs(r)/h;var l=Math.abs(d-o.top),u=(o.end-o.start)/h;r>=0&&(u=(o.end-p.getTime())/h),o.lines=u,u>l&&(o.lines=l),e.by_hour.push(o)})},n.prototype._hour_min=function(t){var e=this.options.time_start.split(":"),a=parseInt(this.options.time_split),o=60/a;return 0==t?o-parseInt(e[1])/a:o},n.prototype._hour=function(t,e){var a=this.options.time_start.split(":"),o=parseInt(this.options.time_split),i=""+(parseInt(a[0])+t*Math.max(o/60,1)),n=""+o*e;return this._format_hour(i.formatNum(2)+":"+n.formatNum(2))},n.prototype._week=function(){this._loadTemplate("week-days");var e={},o=parseInt(this.options.position.start.getTime()),i=parseInt(this.options.position.end.getTime()),n=[],s=this,r=a(this,"first_day");return t.each(this.getEventsBetween(o,i),function(t,e){e.start_day=new Date(parseInt(e.start)).getDay(),1==r&&(e.start_day=(e.start_day+6)%7),e.days=864e5>=e.end-e.start?1:(e.end-e.start)/864e5,o>e.start&&(e.days=e.days-(o-e.start)/864e5,e.start_day=0),e.days=Math.ceil(e.days),e.start_day+e.days>7&&(e.days=7-e.start_day),n.push(e)}),e.events=n,e.cal=this,s.options.templates["week-days"](e)},n.prototype._month=function(t){this._loadTemplate("year-month");var e={cal:this},a=t+1;e.data_day=this.options.position.start.getFullYear()+"-"+(10>a?"0"+a:a)+"-"+"01",e.month_name=this.locale["m"+t];var o=new Date(this.options.position.start.getFullYear(),t,1,0,0,0);return e.start=parseInt(o.getTime()),e.end=parseInt(new Date(this.options.position.start.getFullYear(),t+1,1,0,0,0).getTime()),e.events=this.getEventsBetween(e.start,e.end),this.options.templates["year-month"](e)},n.prototype._day=function(e,o){this._loadTemplate("month-day");var i={tooltip:"",cal:this},n=this.options.classes.months.outmonth,s=this.options.position.start.getDay();2==a(this,"first_day")?s++:s=0==s?7:s,o=o-s+1;var r=new Date(this.options.position.start.getFullYear(),this.options.position.start.getMonth(),o,0,0,0);o>0&&(n=this.options.classes.months.inmonth);var l=new Date(this.options.position.end.getTime()-1).getDate();if(o+1>l&&(this.stop_cycling=!0),o>l&&(o-=l,n=this.options.classes.months.outmonth),n=t.trim(n+" "+this._getDayClass("months",r)),0>=o){var d=new Date(this.options.position.start.getFullYear(),this.options.position.start.getMonth(),0).getDate();o=d-Math.abs(o),n+=" cal-month-first-row"}var h=this._getHoliday(r);return h!==!1&&(i.tooltip=h),i.data_day=r.getFullYear()+"-"+r.getMonthFormatted()+"-"+(10>o?"0"+o:o),i.cls=n,i.day=o,i.start=parseInt(r.getTime()),i.end=parseInt(i.start+864e5),i.events=this.getEventsBetween(i.start,i.end),this.options.templates["month-day"](i)},n.prototype._getHoliday=function(e){var a=!1;return t.each(o(this,e.getFullYear()),function(){var o=!1;return t.each(this.days,function(){return this.toDateString()==e.toDateString()?(o=!0,!1):void 0}),o?(a=this.name,!1):void 0}),a},n.prototype._getHolidayName=function(t){var e=this._getHoliday(t);return e===!1?"":e},n.prototype._getDayClass=function(t,e){var a=this,o=function(e,o){var i;i=a.options.classes&&t in a.options.classes&&e in a.options.classes[t]?a.options.classes[t][e]:"","string"==typeof i&&i.length&&o.push(i)},i=[];e.toDateString()==(new Date).toDateString()&&o("today",i);var n=this._getHoliday(e);switch(n!==!1&&o("holidays",i),e.getDay()){case 0:o("sunday",i);break;case 6:o("saturday",i)}return o(e.toDateString(),i),i.join(" ")},n.prototype.view=function(t){if(t){if(!this.options.views[t].enable)return;this.options.view=t}this._init_position(),this._loadEvents(),this._render(),this.options.onAfterViewLoad.call(this,this.options.view)},n.prototype.navigate=function(e,a){var o=t.extend({},this.options.position);if("next"==e)switch(this.options.view){case"year":o.start.setFullYear(this.options.position.start.getFullYear()+1);break;case"month":o.start.setMonth(this.options.position.start.getMonth()+1);break;case"week":o.start.setDate(this.options.position.start.getDate()+7);break;case"day":o.start.setDate(this.options.position.start.getDate()+1)}else if("prev"==e)switch(this.options.view){case"year":o.start.setFullYear(this.options.position.start.getFullYear()-1);break;case"month":o.start.setMonth(this.options.position.start.getMonth()-1);break;case"week":o.start.setDate(this.options.position.start.getDate()-7);break;case"day":o.start.setDate(this.options.position.start.getDate()-1)}else"today"==e?o.start.setTime((new Date).getTime()):t.error(this.locale.error_where.format(e));this.options.day=o.start.getFullYear()+"-"+o.start.getMonthFormatted()+"-"+o.start.getDateFormatted(),this.view(),_.isFunction(a)&&a()},n.prototype._init_position=function(){var e,o,i;if("now"==this.options.day){var n=new Date;e=n.getFullYear(),o=n.getMonth(),i=n.getDate()}else if(this.options.day.match(/^\d{4}-\d{2}-\d{2}$/g)){var s=this.options.day.split("-");e=parseInt(s[0],10),o=parseInt(s[1],10)-1,i=parseInt(s[2],10)}else t.error(this.locale.error_dateformat.format(this.options.day));switch(this.options.view){case"year":this.options.position.start.setTime(new Date(e,0,1).getTime()),this.options.position.end.setTime(new Date(e+1,0,1).getTime());break;case"month":this.options.position.start.setTime(new Date(e,o,1).getTime()),this.options.position.end.setTime(new Date(e,o+1,1).getTime());break;case"day":this.options.position.start.setTime(new Date(e,o,i).getTime()),this.options.position.end.setTime(new Date(e,o,i+1).getTime());break;case"week":var r,l=new Date(e,o,i);r=1==a(this,"first_day")?l.getDate()-(l.getDay()+6)%7:l.getDate()-l.getDay(),this.options.position.start.setTime(new Date(e,o,r).getTime()),this.options.position.end.setTime(new Date(e,o,r+7).getTime());break;default:t.error(this.locale.error_noview.format(this.options.view))}return this},n.prototype.getTitle=function(){var t=this.options.position.start;switch(this.options.view){case"year":return this.locale.title_year.format(t.getFullYear());case"month":return this.locale.title_month.format(this.locale["m"+t.getMonth()],t.getFullYear());case"week":return this.locale.title_week.format(t.getWeek(a(this,"week_numbers_iso_8601")),t.getFullYear());case"day":return this.locale.title_day.format(this.locale["d"+t.getDay()],t.getDate(),this.locale["m"+t.getMonth()],t.getFullYear())}},n.prototype.getYear=function(){var t=this.options.position.start;return t.getFullYear()},n.prototype.getMonth=function(){var t=this.options.position.start;return this.locale["m"+t.getMonth()]},n.prototype.getDay=function(){var t=this.options.position.start;return this.locale["d"+t.getDay()]},n.prototype.isToday=function(){var t=(new Date).getTime();return t>this.options.position.start&&this.options.position.end>t},n.prototype.getStartDate=function(){return this.options.position.start},n.prototype.getEndDate=function(){return this.options.position.end},n.prototype._loadEvents=function(){var a=this,o=null;"events_source"in this.options&&""!==this.options.events_source?o=this.options.events_source:"events_url"in this.options&&(o=this.options.events_url,i("The events_url option is DEPRECATED and it will be REMOVED in near future. Please use events_source instead."));var n;switch(t.type(o)){case"function":n=function(){return o(a.options.position.start,a.options.position.end,p)};break;case"array":n=function(){return[].concat(o)};break;case"string":o.length&&(n=function(){var i=[],n=a.options.position.start,s=a.options.position.end,r={from:n.getTime(),to:s.getTime(),utc_offset_from:n.getTimezoneOffset(),utc_offset_to:s.getTimezoneOffset()};return p.length&&(r.browser_timezone=p),t.ajax({url:e(o,r),dataType:"json",type:"GET",async:!1}).done(function(e){e.success||t.error(e.error),e.result&&(i=e.result)}),i})}n||t.error(this.locale.error_loadurl),this.options.onBeforeEventsLoad.call(this,function(){a.options.events.length&&a.options.events_cache||(a.options.events=n(),a.options.events.sort(function(t,e){var a;return a=t.start-e.start,0==a&&(a=t.end-e.end),a})),a.options.onAfterEventsLoad.call(a,a.options.events)})},n.prototype._templatePath=function(t){return"function"==typeof this.options.tmpl_path?this.options.tmpl_path(t):this.options.tmpl_path+t+".html"},n.prototype._loadTemplate=function(e){if(!this.options.templates[e]){var a=this;t.ajax({url:a._templatePath(e),dataType:"html",type:"GET",async:!1,cache:this.options.tmpl_cache}).done(function(t){a.options.templates[e]=_.template(t)})}},n.prototype._update=function(){var e=this;t('*[data-toggle="tooltip"]').tooltip({container:this.options.tooltip_container}),t("*[data-cal-date]").click(function(){var a=t(this).data("cal-view");e.options.day=t(this).data("cal-date"),e.view(a)}),t(".cal-cell").dblclick(function(){var a=t("[data-cal-date]",this).data("cal-view");e.options.day=t("[data-cal-date]",this).data("cal-date"),e.view(a)}),this["_update_"+this.options.view](),this._update_modal()},n.prototype._update_modal=function(){var e=this;if(t("a[data-event-id]",this.context).unbind("click"),e.options.modal){var a=t(e.options.modal);if(a.length){var o=null;"iframe"==e.options.modal_type&&(o=t(document.createElement("iframe")).attr({width:"100%",frameborder:"0"})),t("a[data-event-id]",this.context).on("click",function(i){i.preventDefault(),i.stopPropagation();var n=t(this).attr("href"),s=t(this).data("event-id"),i=_.find(e.options.events,function(t){return t.id==s});"iframe"==e.options.modal_type&&(o.attr("src",n),t(".modal-body",a).html(o)),(!a.data("handled.bootstrap-calendar")||a.data("handled.bootstrap-calendar")&&a.data("handled.event-id")!=i.id)&&a.off("show.bs.modal").off("shown.bs.modal").off("hidden.bs.modal").on("show.bs.modal",function(){var o=t(this).find(".modal-body");switch(e.options.modal_type){case"iframe":var s=o.height()-parseInt(o.css("padding-top"),10)-parseInt(o.css("padding-bottom"),10);t(this).find("iframe").height(Math.max(s,50));break;case"ajax":t.ajax({url:n,dataType:"html",async:!1,success:function(t){o.html(t)}});break;case"template":e._loadTemplate("modal"),o.html(e.options.templates.modal({event:i,calendar:e}))}_.isFunction(e.options.modal_title)&&a.find(".modal-title").html(e.options.modal_title(i))}).on("shown.bs.modal",function(){e.options.onAfterModalShown.call(e,e.options.events)}).on("hidden.bs.modal",function(){e.options.onAfterModalHidden.call(e,e.options.events)}).data("handled.bootstrap-calendar",!0).data("handled.event-id",i.id),a.modal("show")})}}},n.prototype._update_day=function(){t("#cal-day-panel").height(t("#cal-day-panel-hour").height())},n.prototype._update_week=function(){},n.prototype._update_year=function(){this._update_month_year()},n.prototype._update_month=function(){this._update_month_year();var e=this;if(1==this.options.weekbox){var o=t(document.createElement("div")).attr("id","cal-week-box"),i=this.options.position.start.getFullYear()+"-"+this.options.position.start.getMonthFormatted()+"-";e.context.find(".cal-month-box .cal-row-fluid").on("mouseenter",function(){var n=new Date(e.options.position.start),s=t(".cal-cell1:first-child .cal-month-day",this),r=s.hasClass("cal-month-first-row")?1:t("[data-cal-date]",s).text();n.setDate(parseInt(r)),r=10>r?"0"+r:r,o.html(e.locale.week.format(1==e.options.display_week_numbers?n.getWeek(a(e,"week_numbers_iso_8601")):"")),o.attr("data-cal-week",i+r).show().appendTo(s)}).on("mouseleave",function(){o.hide()}),o.click(function(){e.options.day=t(this).data("cal-week"),e.view("week")})}e.context.find("a.event").mouseenter(function(){t('a[data-event-id="'+t(this).data("event-id")+'"]').closest(".cal-cell1").addClass("day-highlight dh-"+t(this).data("event-class"))}),e.context.find("a.event").mouseleave(function(){t("div.cal-cell1").removeClass("day-highlight dh-"+t(this).data("event-class"))})},n.prototype._update_month_year=function(){if(this.options.views[this.options.view].slide_events){var e=this,a=t(document.createElement("div")).attr("id","cal-day-tick").html('');e.context.find(".cal-month-day, .cal-year-box .span3").on("mouseenter",function(){0!=t(".events-list",this).length&&t(this).children("[data-cal-date]").text()!=e.activecell&&a.show().appendTo(this)}).on("mouseleave",function(){a.hide()}).on("click",function(i){0!=t(".events-list",this).length&&t(this).children("[data-cal-date]").text()!=e.activecell&&s(i,a,o,e)});var o=t(document.createElement("div")).attr("id","cal-slide-box");o.hide().click(function(t){t.stopPropagation()}),this._loadTemplate("events-list"),a.click(function(a){s(a,t(this),o,e)})}},n.prototype.getEventsBetween=function(e,a){var o=[];return t.each(this.options.events,function(){if(null==this.start)return!0;var t=this.end||this.start;a>parseInt(this.start)&&parseInt(t)>=e&&o.push(this)}),o},t.fn.calendar=function(t){return new n(t,this)}}(jQuery); \ No newline at end of file diff --git a/package.json b/package.json index e0ce0cd1..845a0b0c 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,31 @@ { "name": "bootstrap-calendar", - "version": "0.2.4", - "description": "Bootstrap full view calendar", + "version": "0.2.5", + "description": "Calendar module based on Bootsrap and jQuery", "main": "./js/calendar.js", + "dependencies": { + "bower": "^0.8.5", + "grunt": "^0.4.1", + "grunt-contrib-cssmin": "^0.5.0", + "grunt-contrib-less": "^0.7.0", + "grunt-contrib-uglify": "^0.2.0" + }, + "devDependencies": {}, "scripts": { - "test": "" + "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", - "url": "https://github.com/Serhioromano/bootstrap-calendar.git" + "url": "git+https://github.com/Serhioromano/bootstrap-calendar.git" }, "keywords": [ "calendar" ], - "author": "Sergey Romanov", - "license": "BSD", "readmeFilename": "README.md", - "gitHead": "fc46075a07e08b1796f959c6562d851acce00751", - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-less": "~0.7.0", - "grunt-contrib-uglify": "~0.2.0", - "bower": "~0.8.5" - } -} + "author": "Sergey Romanov", + "license": "AML", + "bugs": { + "url": "https://github.com/Serhioromano/bootstrap-calendar/issues" + }, + "homepage": "https://github.com/Serhioromano/bootstrap-calendar#readme" +} \ No newline at end of file