diff --git a/dist/angular-datepicker.js b/dist/angular-datepicker.js index 971dbc9..1e7d435 100644 --- a/dist/angular-datepicker.js +++ b/dist/angular-datepicker.js @@ -52,13 +52,13 @@ return [ '
', '
', - '', + '', prevButton, '', '
', '
', '{{month}} ', - '', + '', '', '{{year}}', '', @@ -66,7 +66,7 @@ '', '
', '
', - '', + '', nextButton, '', '
', @@ -78,15 +78,15 @@ return [ '
', '', '', @@ -107,13 +107,13 @@ return [ '' diff --git a/dist/angular-datepicker.min.js b/dist/angular-datepicker.min.js index 13c53aa..5ebcf78 100644 --- a/dist/angular-datepicker.min.js +++ b/dist/angular-datepicker.min.js @@ -4,9 +4,9 @@ * Released by 720kb.net under the MIT license * www.opensource.org/licenses/MIT * - * 2017-06-28 + * 2018-09-04 */ -!function(e,a){"use strict";var t=function(){if(a.userAgent&&(a.userAgent.match(/Android/i)||a.userAgent.match(/webOS/i)||a.userAgent.match(/iPhone/i)||a.userAgent.match(/iPad/i)||a.userAgent.match(/iPod/i)||a.userAgent.match(/BlackBerry/i)||a.userAgent.match(/Windows Phone/i)))return!0}(),n=function(e,a,n){return n&&(t=!1),t?['
','
','","
","
",'
','
','","
","
"]:['
','
','',e,"","
",'
',"{{month}} ",'',"","{{year}}","","","","
",'
','',a,"","
","
"]},i=function(e,a){return['
','",'
','',e,"",'',a,"","
","
"]},r=function(e,a,t){var r=['
',"
"],d=n(e,a,t),l=i(e,a),c=['
','
',"{{d}}","
","
"],o=['"],s=function(e){r.splice(r.length-1,0,e)};return d.forEach(s),l.forEach(s),c.forEach(s),o.forEach(s),r.join("")},d=function(a,n,i,d,l,c){return{restrict:"AEC",scope:{dateSet:"@",dateMinLimit:"@",dateMaxLimit:"@",dateMonthTitle:"@",dateYearTitle:"@",buttonNextTitle:"@",buttonPrevTitle:"@",dateDisabledDates:"@",dateEnabledDates:"@",dateDisabledWeekdays:"@",dateSetHidden:"@",dateTyper:"@",dateWeekStartDay:"@",datepickerAppendTo:"@",datepickerToggle:"@",datepickerClass:"@",datepickerShow:"@"},link:function(o,s,m){var u,b,h,y=m.selector,p=e.element(y?s[0].querySelector("."+y):s[0].children[0]),g=m.buttonPrev||'',M=m.buttonNext||'',k=m.dateFormat,f=o.$eval(o.dateDisabledDates),D=o.$eval(o.dateEnabledDates),v=o.$eval(o.dateDisabledWeekdays),N=new Date,S=!1,w=!1,x=void 0!==m.datepickerMobile&&"false"!==m.datepickerMobile,Y=i.DATETIME_FORMATS,T=r(g,M,x),_=function(){S||w||!u||o.hideCalendar()},L=function(e,a){var t,n,i,r,d,l=new Date(a,e,0).getDate(),c=new Date(a+"/"+e+"/1").getDay(),s=new Date(a+"/"+e+"/"+l).getDay(),m=[],u=[];for(o.days=[],o.dateWeekStartDay=o.validateWeekDay(o.dateWeekStartDay),d=(o.dateWeekStartDay+6)%7,t=1;t<=l;t+=1)o.days.push(t);if(c===o.dateWeekStartDay)o.prevMonthDays=[];else{for(i=c-o.dateWeekStartDay,c0}),t=a.match(m).filter(function(e){return null!==e.match(/^[a-zA-Z]+$/i)}),l=0;l-1||((t=e.className.split(" ")).push(a),e.className=t.join(" "))},remove:function(e,a){var t,n;if(-1!==e.className.indexOf(a)){for(n=e.className.split(" "),t=0;tNumber(e)&&!o.isSelectableMinYear(e))return;o.paginateYears(e),o.showYearsPagination=!1,c(function(){o.year=Number(e),L(o.monthNumber,o.year)},0)},o.hideCalendar=function(){u.classList?u.classList.remove("_720kb-datepicker-open"):O.remove(u,"_720kb-datepicker-open")},o.setDatepickerDay=function(e){o.isSelectableDay(o.monthNumber,o.year,e)&&o.isSelectableDate(o.monthNumber,o.year,e)&&o.isSelectableMaxDate(o.year+"/"+o.monthNumber+"/"+e)&&o.isSelectableMinDate(o.year+"/"+o.monthNumber+"/"+e)&&(o.day=Number(e),o.selectedDay=o.day,o.selectedMonth=o.monthNumber,o.selectedYear=o.year,H(),m.hasOwnProperty("dateRefocus")&&p[0].focus(),o.hideCalendar())},o.paginateYears=function(e){var a,n=[],i=10,r=10;for(o.paginationYears=[],t&&(i=50,r=50,o.dateMinLimit&&o.dateMaxLimit&&(i=(e=new Date(o.dateMaxLimit).getFullYear())-new Date(o.dateMinLimit).getFullYear(),r=1)),a=i;a>0;a-=1)n.push(Number(e)-a);for(a=0;a0)try{(N=k?E(p[0].value.toString(),k):new Date(p[0].value.toString())).getFullYear()&&!isNaN(N.getDay())&&!isNaN(N.getMonth())&&o.isSelectableDay(N.getMonth(),N.getFullYear(),N.getDay())&&o.isSelectableDate(N.getMonth(),N.getFullYear(),N.getDay())&&o.isSelectableMaxDate(N)&&o.isSelectableMinDate(N)&&o.$apply(function(){o.month=d("date")(N,"MMMM"),o.monthNumber=Number(d("date")(N,"MM")),o.day=Number(d("date")(N,"dd")),4===N.getFullYear().toString().length&&(o.year=Number(d("date")(N,"yyyy"))),L(o.monthNumber,o.year)})}catch(e){return e}}),o.dateMaxLimit&&n&&n.length&&!o.isSelectableMaxYear(Number(n[n.length-1])+1)?o.paginationYearsNextDisabled=!0:o.paginationYearsNextDisabled=!1,o.dateMinLimit&&n&&n.length&&!o.isSelectableMinYear(Number(n[0])-1)?o.paginationYearsPrevDisabled=!0:o.paginationYearsPrevDisabled=!1,o.paginationYears=n},o.isSelectableDay=function(e,a,t){var n=0;if(v&&v.length>0)for(n;n<=v.length;n+=1)if(v[n]===new Date(e+"/"+t+"/"+a).getDay())return!1;return!0},o.isSelectableDate=function(e,a,t){var n=0;if(f&&f.length>0)for(n;n<=f.length;n+=1)if(new Date(f[n]).getTime()===new Date(e+"/"+t+"/"+a).getTime())return!1;if(D){for(n;n<=D.length;n+=1)if(new Date(D[n]).getTime()===new Date(e+"/"+t+"/"+a).getTime())return!0;return!1}return!0},o.isSelectableMinDate=function(e){return!(o.dateMinLimit&&new Date(o.dateMinLimit)&&new Date(e).getTime()new Date(o.dateMaxLimit).getTime())},o.isSelectableMaxYear=function(e){return!(o.dateMaxLimit&&e>new Date(o.dateMaxLimit).getFullYear())},o.isSelectableMinYear=function(e){return!(o.dateMinLimit&&e6)&&(a=0),a},T=T.replace(/{{/g,l.startSymbol()).replace(/}}/g,l.endSymbol()),o.dateMonthTitle=o.dateMonthTitle||"Select month",o.dateYearTitle=o.dateYearTitle||"Select year",o.buttonNextTitle=o.buttonNextTitle||"Next",o.buttonPrevTitle=o.buttonPrevTitle||"Prev",o.month=d("date")(N,"MMMM"),o.monthNumber=Number(d("date")(N,"MM")),o.day=Number(d("date")(N,"dd")),o.dateWeekStartDay=o.validateWeekDay(o.dateWeekStartDay),o.dateMaxLimit?o.year=Number(d("date")(new Date(o.dateMaxLimit),"yyyy")):o.year=Number(d("date")(N,"yyyy")),o.months=Y.MONTH,o.daysInString=[],h=o.dateWeekStartDay;h<=o.dateWeekStartDay+6;h+=1)o.daysInString.push(h%7);o.daysInString=o.daysInString.map(function(e){return d("date")(new Date(new Date("06/08/2014").valueOf()+864e5*e),"EEE")}),o.datepickerAppendTo&&-1!==o.datepickerAppendTo.indexOf(".")?(o.datepickerID="datepicker-id-"+(new Date).getTime()+(Math.floor(6*Math.random())+8),e.element(document.getElementsByClassName(o.datepickerAppendTo.replace(".",""))[0]).append(n(e.element(T))(o,function(a){u=e.element(a)[0]}))):o.datepickerAppendTo&&-1!==o.datepickerAppendTo.indexOf("#")?(o.datepickerID="datepicker-id-"+(new Date).getTime()+(Math.floor(6*Math.random())+8),e.element(document.getElementById(o.datepickerAppendTo.replace("#",""))).append(n(e.element(T))(o,function(a){u=e.element(a)[0]}))):o.datepickerAppendTo&&"body"===o.datepickerAppendTo?(o.datepickerID="datepicker-id-"+((new Date).getTime()+(Math.floor(6*Math.random())+8)),e.element(document).find("body").append(n(e.element(T))(o,function(a){u=e.element(a)[0]}))):(p.after(n(e.element(T))(o)),u=s[0].querySelector("._720kb-datepicker-calendar")),function(){return!o.datepickerToggle||o.$eval(o.datepickerToggle)}()&&p.on("focus click focusin",function(){w=!0,S||w||!u?F():o.hideCalendar()}),p.on("focusout blur",function(){w=!1}),e.element(u).on("mouseenter",function(){S=!0}),e.element(u).on("mouseleave",function(){S=!1}),e.element(u).on("focusin",function(){S=!0}),e.element(a).on("click focus focusin",_),(o.dateMinLimit&&!o.isSelectableMinYear(o.year)||!o.isSelectableMinDate(o.year+"/"+o.monthNumber+"/"+o.day))&&$(),(o.dateMaxLimit&&!o.isSelectableMaxYear(o.year)||!o.isSelectableMaxDate(o.year+"/"+o.monthNumber+"/"+o.day))&&A(),o.paginateYears(o.year),L(o.monthNumber,o.year),o.checkVisibility=j,o.$on("$destroy",function(){I(),C(),B(),G(),z(),R(),p.off("focus click focusout blur"),e.element(u).off("mouseenter mouseleave focusin"),e.element(a).off("click focus focusin",_)})}}};e.module("720kb.datepicker",[]).directive("datepicker",["$window","$compile","$locale","$filter","$interpolate","$timeout",d])}(angular,navigator); +!function(C,e){"use strict";var B=function(){if(e.userAgent&&(e.userAgent.match(/Android/i)||e.userAgent.match(/webOS/i)||e.userAgent.match(/iPhone/i)||e.userAgent.match(/iPad/i)||e.userAgent.match(/iPod/i)||e.userAgent.match(/BlackBerry/i)||e.userAgent.match(/Windows Phone/i)))return!0}(),G=function(e,a,t){var n,i,r=['
',"
"],d=(n=e,i=a,t&&(B=!1),B?['
','
','","
","
",'
','
','","
","
"]:['
','
','',n,"","
",'
',"{{month}} ",'',"","{{year}}","","","","
",'
','',i,"","
","
"]),l=['
','",'
','',e,"",'',a,"","
","
"],c=['
','
',"{{d}}","
","
"],o=['"],s=function(e){r.splice(r.length-1,0,e)};return d.forEach(s),l.forEach(s),c.forEach(s),o.forEach(s),r.join("")};C.module("720kb.datepicker",[]).directive("datepicker",["$window","$compile","$locale","$filter","$interpolate","$timeout",function(W,E,H,O,F,I){return{restrict:"AEC",scope:{dateSet:"@",dateMinLimit:"@",dateMaxLimit:"@",dateMonthTitle:"@",dateYearTitle:"@",buttonNextTitle:"@",buttonPrevTitle:"@",dateDisabledDates:"@",dateEnabledDates:"@",dateDisabledWeekdays:"@",dateSetHidden:"@",dateTyper:"@",dateWeekStartDay:"@",datepickerAppendTo:"@",datepickerToggle:"@",datepickerClass:"@",datepickerShow:"@"},link:function(u,e,a){var t,n,i,r=a.selector,d=C.element(r?e[0].querySelector("."+r):e[0].children[0]),l=a.buttonPrev||'',c=a.buttonNext||'',o=a.dateFormat,s=u.$eval(u.dateDisabledDates),m=u.$eval(u.dateEnabledDates),b=u.$eval(u.dateDisabledWeekdays),h=new Date,y=!1,p=!1,g=void 0!==a.datepickerMobile&&"false"!==a.datepickerMobile,M=H.DATETIME_FORMATS,k=G(l,c,g),f=function(){y||p||!t||u.hideCalendar()},D=function(e,a){var t,n,i,r,d,l=new Date(a,e,0).getDate(),c=new Date(a+"/"+e+"/1").getDay(),o=new Date(a+"/"+e+"/"+l).getDay(),s=[],m=[];for(u.days=[],u.dateWeekStartDay=u.validateWeekDay(u.dateWeekStartDay),d=(u.dateWeekStartDay+6)%7,t=1;t<=l;t+=1)u.days.push(t);if(c===u.dateWeekStartDay)u.prevMonthDays=[];else{for(i=c-u.dateWeekStartDay,cNumber(e)&&!u.isSelectableMinYear(e))return;u.paginateYears(e),u.showYearsPagination=!1,I(function(){u.year=Number(e),D(u.monthNumber,u.year)},0)},u.hideCalendar=function(){t.classList?t.classList.remove("_720kb-datepicker-open"):Y(t,"_720kb-datepicker-open")},u.setDatepickerDay=function(e){u.isSelectableDay(u.monthNumber,u.year,e)&&u.isSelectableDate(u.monthNumber,u.year,e)&&u.isSelectableMaxDate(u.year+"/"+u.monthNumber+"/"+e)&&u.isSelectableMinDate(u.year+"/"+u.monthNumber+"/"+e)&&(u.day=Number(e),u.selectedDay=u.day,u.selectedMonth=u.monthNumber,u.selectedYear=u.year,w(),a.hasOwnProperty("dateRefocus")&&d[0].focus(),u.hideCalendar())},u.paginateYears=function(e){var a,t=[],n=10,i=10;for(u.paginationYears=[],B&&(i=n=50,u.dateMinLimit&&u.dateMaxLimit&&(n=(e=new Date(u.dateMaxLimit).getFullYear())-new Date(u.dateMinLimit).getFullYear(),i=1)),a=n;0new Date(u.dateMaxLimit).getTime())},u.isSelectableMaxYear=function(e){return!(u.dateMaxLimit&&e>new Date(u.dateMaxLimit).getFullYear())},u.isSelectableMinYear=function(e){return!(u.dateMinLimit&&e', '', '', '', @@ -78,15 +78,15 @@ return [ '
', '', '', @@ -107,13 +107,13 @@ return [ ''