From f8817414a319dc14249b785f16b18f5171791961 Mon Sep 17 00:00:00 2001 From: rajeshwarpatlolla Date: Fri, 8 Jul 2016 00:56:26 +0530 Subject: [PATCH] css change in popup --- README.md | 2 +- dist/ionic-datepicker.bundle.min.js | 2 +- src/ionic-datepicker-popup.html | 9 +++++---- src/ionic-datepicker.styles.css | 4 ++++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 14191312..d0da328a 100755 --- a/README.md +++ b/README.md @@ -344,7 +344,7 @@ Few more features are also added apart from the above mentioned features. ### 15) v1.2.0 -Lots of bug fixes. +Lots of bug fixes. Lots of PR's merged. ##License: diff --git a/dist/ionic-datepicker.bundle.min.js b/dist/ionic-datepicker.bundle.min.js index 37fb0a10..c5df4d16 100755 --- a/dist/ionic-datepicker.bundle.min.js +++ b/dist/ionic-datepicker.bundle.min.js @@ -1 +1 @@ -!function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(a){n.innerText=t}}(document,".padding_zero {\n padding: 0;\n}\n\n.ionic_datepicker_popup .font_bold {\n font-weight: bold;\n}\n\n.ionic_datepicker_popup .padding_top_zero {\n padding-top: 0;\n}\n\n.ionic_datepicker_popup .padding_left_5px {\n padding-left: 5px;\n}\n\n.ionic_datepicker_popup .padding_right_5px {\n padding-right: 5px;\n}\n\n.ionic_datepicker_popup .calendar_grid {\n height: 215px;\n}\n\n.ionic_datepicker_popup .calendar_grid .weeks_row {\n padding: 0;\n}\n\n.ionic_datepicker_popup .today {\n border: 1px solid #009688;\n border-radius: 50%;\n}\n\n.ionic_datepicker_popup .selected_date {\n background-color: #009688;\n border-radius: 50%;\n color: #fff;\n font-weight: bold;\n}\n\n.ionic_datepicker_popup .popup-head {\n background-color: #009688;\n display: none;\n}\n\n.ionic_datepicker_popup .popup-head .popup-title {\n color: #ffffff;\n}\n\n.ionic_datepicker_popup .popup-head .popup-sub-title {\n color: #ffffff;\n}\n\n.ionic_datepicker_popup .popup-body {\n background-color: #ffffff;\n}\n\n.ionic_datepicker_popup .popup-body .selected_date_full {\n background-color: #019688;\n margin: -10px -10px 0 -10px;\n height: 45px;\n text-align: center;\n font-weight: bold;\n color: #fff;\n line-height: 45px;\n font-size: 18px;\n}\n\n.ionic_datepicker_popup .popup-body .select_section {\n padding: 1px 5px;\n}\n\n.ionic_datepicker_popup .popup-body .pointer_events_none {\n pointer-events: none;\n color: #aaaaaa !important;\n}\n\n.ionic_datepicker_popup .popup-body .month_select, .ionic_datepicker_popup .popup-body .year_select {\n border: none;\n border-bottom: 1px solid #009688;\n padding: 0;\n}\n\n.ionic_datepicker_popup .popup-body .month_select .input-label, .ionic_datepicker_popup .popup-body .year_select .input-label {\n padding: 2px 0;\n width: 0;\n}\n\n.ionic_datepicker_popup .popup-body .month_select select, .ionic_datepicker_popup .popup-body .year_select select {\n left: 10px;\n border: none;\n padding: 0;\n}\n\n.ionic_datepicker_popup .popup-body .month_select:after, .ionic_datepicker_popup .popup-body .year_select:after {\n right: 5px;\n color: #009688;\n}\n\n.ionic_datepicker_popup .popup-body .show_nav {\n padding: 10px 0 0 0;\n}\n\n.ionic_datepicker_popup .popup-body .show_nav .prev_btn_section {\n padding: 5px 0;\n text-align: left;\n}\n\n.ionic_datepicker_popup .popup-body .show_nav .prev_btn_section button {\n padding: 0;\n}\n\n.ionic_datepicker_popup .popup-body .show_nav .next_btn_section {\n padding: 5px 0;\n text-align: right;\n}\n\n.ionic_datepicker_popup .popup-body .show_nav .next_btn_section button {\n padding: 0;\n}\n\n.ionic_datepicker_popup .popup-body .button-clear {\n color: #009688;\n}\n\n.ionic_datepicker_popup .popup-buttons {\n padding: 0;\n min-height: 45px;\n}\n\n.ionic_datepicker_popup .popup-buttons button {\n background-color: #009688;\n border-radius: 0;\n margin-right: 1px;\n color: #ffffff;\n}\n\n.ionic_datepicker_popup .row + .row {\n padding: 0;\n}\n\n.ionic_datepicker_modal .header, .ionic_datepicker_modal .footer {\n background-color: #009688;\n}\n\n.ionic_datepicker_modal .header .title, .ionic_datepicker_modal .header .button, .ionic_datepicker_modal .footer .title, .ionic_datepicker_modal .footer .button {\n color: #ffffff;\n}\n\n.ionic_datepicker_modal .footer .button-block {\n margin: 0;\n}\n\n.ionic_datepicker_modal .today {\n border: 1px solid #009688;\n}\n\n.ionic_datepicker_modal .selected_date {\n background-color: #009688;\n color: #fff;\n font-weight: bold;\n}\n\n.ionic_datepicker_modal .pointer_events_none {\n pointer-events: none;\n color: #aaaaaa !important;\n}\n\n.ionic_datepicker_modal .select_section {\n padding: 1px 5px;\n}\n\n.ionic_datepicker_modal .button-clear {\n color: #009688;\n}\n\n.ionic_datepicker_modal .month_select, .ionic_datepicker_modal .year_select {\n border: none;\n border-bottom: 1px solid #009688;\n padding: 0;\n}\n\n.ionic_datepicker_modal .month_select .input-label, .ionic_datepicker_modal .year_select .input-label {\n padding: 2px 0;\n width: 0;\n}\n\n.ionic_datepicker_modal .month_select select, .ionic_datepicker_modal .year_select select {\n left: 10px;\n border: none;\n padding: 0 10px;\n}\n\n.ionic_datepicker_modal .month_select:after, .ionic_datepicker_modal .year_select:after {\n right: 5px;\n color: #009688;\n}\n\n.ionic_datepicker_modal .padding_left_5px {\n padding-left: 5px;\n}\n\n.ionic_datepicker_modal .padding_right_5px {\n padding-right: 5px;\n}\n\n.ionic_datepicker_modal .date_col {\n height: 50px;\n line-height: 50px;\n}\n\n.ionic_datepicker_modal .font_bold {\n font-weight: bold;\n}\n\n.ionic_datepicker_modal .font_22px {\n font-size: 22px;\n}\n\n.platform-android .ionic_datepicker_modal .bar .title.title-left {\n text-align: center;\n}\n\n.platform-android .ionic_datepicker_modal select {\n left: 25%;\n}\n\n.platform-ios .ionic_datepicker_modal select {\n left: 5%;\n}"),function(e){try{e=angular.module("ionic-datepicker.templates")}catch(t){e=angular.module("ionic-datepicker.templates",[])}e.run(["$templateCache",function(e){e.put("ionic-datepicker-modal.html",'

{{selctedDateEpoch | date : mainObj.dateFormat}}

{{dayList[row + col].date}}
')}])}(),function(e){try{e=angular.module("ionic-datepicker.templates")}catch(t){e=angular.module("ionic-datepicker.templates",[])}e.run(["$templateCache",function(e){e.put("ionic-datepicker-popup.html",'
{{selctedDateEpoch | date : mainObj.dateFormat}}
{{dayList[row + col].date}}
')}])}(),angular.module("ionic-datepicker",["ionic","ionic-datepicker.service","ionic-datepicker.provider","ionic-datepicker.templates"]),angular.module("ionic-datepicker.provider",[]).provider("ionicDatePicker",function(){var e={setLabel:"Set",todayLabel:"Today",closeLabel:"Close",inputDate:new Date,mondayFirst:!0,weeksList:["S","M","T","W","T","F","S"],monthsList:["Jan","Feb","March","April","May","June","July","Aug","Sept","Oct","Nov","Dec"],templateType:"popup",showTodayButton:!1,closeOnSelect:!1,disableWeekdays:[]};this.configDatePicker=function(t){angular.extend(e,t)},this.$get=["$rootScope","$ionicPopup","$ionicModal","IonicDatepickerService",function(t,n,a,o){function i(e){return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function c(e){e.disabledDates&&0!==e.disabledDates.length?(u.disabledDates=[],angular.forEach(e.disabledDates,function(e,t){e=i(new Date(e)),u.disabledDates.push(e.getTime())})):u.disabledDates=[]}function d(e){e=i(e),u.currentDate=angular.copy(e);var t=new Date(e.getFullYear(),e.getMonth(),1).getDate(),n=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();u.monthsList=[],u.mainObj.monthsList&&12===u.mainObj.monthsList.length?u.monthsList=u.mainObj.monthsList:u.monthsList=o.monthsList,u.yearsList=o.getYearsList(u.mainObj.from,u.mainObj.to),u.dayList=[];var a,c;u.firstDayEpoch=i(new Date(e.getFullYear(),e.getMonth(),t)).getTime(),u.lastDayEpoch=i(new Date(e.getFullYear(),e.getMonth(),n)).getTime();for(var d=t;n>=d;d++)a=new Date(e.getFullYear(),e.getMonth(),d),c=a.getTime()u.toDate||u.mainObj.disableWeekdays.indexOf(a.getDay())>=0,u.dayList.push({date:a.getDate(),month:a.getMonth(),year:a.getFullYear(),day:a.getDay(),epoch:a.getTime(),disabled:c});var r=u.dayList[0].day-u.mainObj.mondayFirst;r=0>r?6:r;for(var p=0;r>p;p++)u.dayList.unshift({});u.rows=[0,7,14,21,28,35],u.cols=[0,1,2,3,4,5,6],u.data.currentMonth=u.mainObj.monthsList[e.getMonth()],u.data.currentYear=e.getFullYear(),u.data.currentMonthSelected=angular.copy(u.data.currentMonth),u.currentYearSelected=angular.copy(u.data.currentYear),u.numColumns=7}function r(e){u.mainObj=angular.copy(e),u.selctedDateEpoch=i(u.mainObj.inputDate).getTime(),u.mainObj.weeksList&&7===u.mainObj.weeksList.length?u.weeksList=u.mainObj.weeksList:u.weeksList=["S","M","T","W","T","F","S"],u.mainObj.mondayFirst&&u.weeksList.push(u.mainObj.weeksList.shift()),u.disableWeekdays=u.mainObj.disableWeekdays,d(u.mainObj.inputDate),c(u.mainObj)}function p(){u.modal.show()}function l(){u.modal.hide()}var s={},u=t.$new();return u.today=i(new Date).getTime(),u.disabledDates=[],u.data={},u.prevMonth=function(){1===u.currentDate.getMonth()&&u.currentDate.setFullYear(u.currentDate.getFullYear()),u.currentDate.setMonth(u.currentDate.getMonth()-1),u.data.currentMonth=u.mainObj.monthsList[u.currentDate.getMonth()],u.data.currentYear=u.currentDate.getFullYear(),d(u.currentDate)},u.nextMonth=function(){11===u.currentDate.getMonth()&&u.currentDate.setFullYear(u.currentDate.getFullYear()),u.currentDate.setDate(1),u.currentDate.setMonth(u.currentDate.getMonth()+1),u.data.currentMonth=u.mainObj.monthsList[u.currentDate.getMonth()],u.data.currentYear=u.currentDate.getFullYear(),d(u.currentDate)},u.dateSelected=function(e){e&&0!==Object.keys(e).length&&(u.selctedDateEpoch=e.epoch,u.mainObj.closeOnSelect&&(u.mainObj.callback(u.selctedDateEpoch),"popup"==u.mainObj.templateType.toLowerCase()?u.popup.close():l()))},u.setIonicDatePickerTodayDate=function(){var e=new Date;d(new Date),u.selctedDateEpoch=i(e).getTime(),u.mainObj.closeOnSelect&&(u.mainObj.callback(u.selctedDateEpoch),l())},u.setIonicDatePickerDate=function(){u.mainObj.callback(u.selctedDateEpoch),l()},u.monthChanged=function(e){var t=u.monthsList.indexOf(e);u.currentDate.setMonth(t),d(u.currentDate)},u.yearChanged=function(e){u.currentDate.setFullYear(e),d(u.currentDate)},a.fromTemplateUrl("ionic-datepicker-modal.html",{scope:u,animation:"slide-in-up"}).then(function(e){u.modal=e}),u.$on("$destroy",function(){u.modal.remove()}),u.closeIonicDatePickerModal=function(){l()},s.openDatePicker=function(t){var a=[];delete u.fromDate,delete u.toDate,u.mainObj=angular.extend({},e,t),u.mainObj.from&&(u.fromDate=i(new Date(u.mainObj.from)).getTime()),u.mainObj.to&&(u.toDate=i(new Date(u.mainObj.to)).getTime()),t.disableWeekdays&&e.disableWeekdays&&(u.mainObj.disableWeekdays=t.disableWeekdays.concat(e.disableWeekdays)),r(u.mainObj),u.mainObj.closeOnSelect||(a=[{text:u.mainObj.setLabel,type:"button_set",onTap:function(e){u.mainObj.callback(u.selctedDateEpoch)}}]),u.mainObj.showTodayButton&&a.push({text:u.mainObj.todayLabel,type:"button_today",onTap:function(e){var t=new Date;d(new Date),u.selctedDateEpoch=i(t).getTime(),u.mainObj.closeOnSelect||e.preventDefault()}}),a.push({text:u.mainObj.closeLabel,type:"button_close",onTap:function(e){console.log("ionic-datepicker popup closed.")}}),"popup"==u.mainObj.templateType.toLowerCase()?u.popup=n.show({templateUrl:"ionic-datepicker-popup.html",scope:u,cssClass:"ionic_datepicker_popup",buttons:a}):p()},s}]}),angular.module("ionic-datepicker.service",[]).service("IonicDatepickerService",function(){this.monthsList=["January","February","March","April","May","June","July","August","September","October","November","December"],this.getYearsList=function(e,t){var n=[],a=1900,o=2100;a=e?new Date(e).getFullYear():a,o=t?new Date(t).getFullYear():o;for(var i=a;o>=i;i++)n.push(i);return n}}); \ No newline at end of file +!function(e,n){var t=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(t),t.styleSheet)t.styleSheet.disabled||(t.styleSheet.cssText=n);else try{t.innerHTML=n}catch(a){t.innerText=n}}(document,".padding_zero {\n padding: 0;\n}\n\n.ionic_datepicker_popup .font_bold {\n font-weight: bold;\n}\n\n.ionic_datepicker_popup .padding_top_zero {\n padding-top: 0;\n}\n\n.ionic_datepicker_popup .padding_left_5px {\n padding-left: 5px;\n}\n\n.ionic_datepicker_popup .padding_right_5px {\n padding-right: 5px;\n}\n\n.ionic_datepicker_popup .month_year_section {\n padding: 5px 0;\n}\n\n.ionic_datepicker_popup .calendar_grid {\n height: 215px;\n}\n\n.ionic_datepicker_popup .calendar_grid .weeks_row {\n padding: 0;\n}\n\n.ionic_datepicker_popup .today {\n border: 1px solid #009688;\n border-radius: 50%;\n}\n\n.ionic_datepicker_popup .selected_date {\n background-color: #009688;\n border-radius: 50%;\n color: #fff;\n font-weight: bold;\n}\n\n.ionic_datepicker_popup .popup-head {\n background-color: #009688;\n display: none;\n}\n\n.ionic_datepicker_popup .popup-head .popup-title {\n color: #ffffff;\n}\n\n.ionic_datepicker_popup .popup-head .popup-sub-title {\n color: #ffffff;\n}\n\n.ionic_datepicker_popup .popup-body {\n background-color: #ffffff;\n}\n\n.ionic_datepicker_popup .popup-body .selected_date_full {\n background-color: #019688;\n margin: -10px -10px 0 -10px;\n height: 45px;\n text-align: center;\n font-weight: bold;\n color: #fff;\n line-height: 45px;\n font-size: 18px;\n}\n\n.ionic_datepicker_popup .popup-body .select_section {\n padding: 1px 5px;\n}\n\n.ionic_datepicker_popup .popup-body .pointer_events_none {\n pointer-events: none;\n color: #aaaaaa !important;\n}\n\n.ionic_datepicker_popup .popup-body .month_select, .ionic_datepicker_popup .popup-body .year_select {\n border: none;\n border-bottom: 1px solid #009688;\n padding: 0;\n}\n\n.ionic_datepicker_popup .popup-body .month_select .input-label, .ionic_datepicker_popup .popup-body .year_select .input-label {\n padding: 2px 0;\n width: 0;\n}\n\n.ionic_datepicker_popup .popup-body .month_select select, .ionic_datepicker_popup .popup-body .year_select select {\n left: 10px;\n border: none;\n padding: 0;\n}\n\n.ionic_datepicker_popup .popup-body .month_select:after, .ionic_datepicker_popup .popup-body .year_select:after {\n right: 5px;\n color: #009688;\n}\n\n.ionic_datepicker_popup .popup-body .show_nav {\n padding: 10px 0 0 0;\n}\n\n.ionic_datepicker_popup .popup-body .show_nav .prev_btn_section {\n padding: 5px 0;\n text-align: left;\n}\n\n.ionic_datepicker_popup .popup-body .show_nav .prev_btn_section button {\n padding: 0;\n}\n\n.ionic_datepicker_popup .popup-body .show_nav .next_btn_section {\n padding: 5px 0;\n text-align: right;\n}\n\n.ionic_datepicker_popup .popup-body .show_nav .next_btn_section button {\n padding: 0;\n}\n\n.ionic_datepicker_popup .popup-body .button-clear {\n color: #009688;\n}\n\n.ionic_datepicker_popup .popup-buttons {\n padding: 0;\n min-height: 45px;\n}\n\n.ionic_datepicker_popup .popup-buttons button {\n background-color: #009688;\n border-radius: 0;\n margin-right: 1px;\n color: #ffffff;\n}\n\n.ionic_datepicker_popup .row + .row {\n padding: 0;\n}\n\n.ionic_datepicker_modal .header, .ionic_datepicker_modal .footer {\n background-color: #009688;\n}\n\n.ionic_datepicker_modal .header .title, .ionic_datepicker_modal .header .button, .ionic_datepicker_modal .footer .title, .ionic_datepicker_modal .footer .button {\n color: #ffffff;\n}\n\n.ionic_datepicker_modal .footer .button-block {\n margin: 0;\n}\n\n.ionic_datepicker_modal .today {\n border: 1px solid #009688;\n}\n\n.ionic_datepicker_modal .selected_date {\n background-color: #009688;\n color: #fff;\n font-weight: bold;\n}\n\n.ionic_datepicker_modal .pointer_events_none {\n pointer-events: none;\n color: #aaaaaa !important;\n}\n\n.ionic_datepicker_modal .select_section {\n padding: 1px 5px;\n}\n\n.ionic_datepicker_modal .button-clear {\n color: #009688;\n}\n\n.ionic_datepicker_modal .month_select, .ionic_datepicker_modal .year_select {\n border: none;\n border-bottom: 1px solid #009688;\n padding: 0;\n}\n\n.ionic_datepicker_modal .month_select .input-label, .ionic_datepicker_modal .year_select .input-label {\n padding: 2px 0;\n width: 0;\n}\n\n.ionic_datepicker_modal .month_select select, .ionic_datepicker_modal .year_select select {\n left: 10px;\n border: none;\n padding: 0 10px;\n}\n\n.ionic_datepicker_modal .month_select:after, .ionic_datepicker_modal .year_select:after {\n right: 5px;\n color: #009688;\n}\n\n.ionic_datepicker_modal .padding_left_5px {\n padding-left: 5px;\n}\n\n.ionic_datepicker_modal .padding_right_5px {\n padding-right: 5px;\n}\n\n.ionic_datepicker_modal .date_col {\n height: 50px;\n line-height: 50px;\n}\n\n.ionic_datepicker_modal .font_bold {\n font-weight: bold;\n}\n\n.ionic_datepicker_modal .font_22px {\n font-size: 22px;\n}\n\n.platform-android .ionic_datepicker_modal .bar .title.title-left {\n text-align: center;\n}\n\n.platform-android .ionic_datepicker_modal select {\n left: 25%;\n}\n\n.platform-ios .ionic_datepicker_modal select {\n left: 5%;\n}"),function(e){try{e=angular.module("ionic-datepicker.templates")}catch(n){e=angular.module("ionic-datepicker.templates",[])}e.run(["$templateCache",function(e){e.put("ionic-datepicker-modal.html",'

{{selctedDateEpoch | date : mainObj.dateFormat}}

{{dayList[row + col].date}}
')}])}(),function(e){try{e=angular.module("ionic-datepicker.templates")}catch(n){e=angular.module("ionic-datepicker.templates",[])}e.run(["$templateCache",function(e){e.put("ionic-datepicker-popup.html",'
{{selctedDateEpoch | date : mainObj.dateFormat}}
{{dayList[row + col].date}}
')}])}(),angular.module("ionic-datepicker",["ionic","ionic-datepicker.service","ionic-datepicker.provider","ionic-datepicker.templates"]),angular.module("ionic-datepicker.provider",[]).provider("ionicDatePicker",function(){var e={setLabel:"Set",todayLabel:"Today",closeLabel:"Close",inputDate:new Date,mondayFirst:!0,weeksList:["S","M","T","W","T","F","S"],monthsList:["Jan","Feb","March","April","May","June","July","Aug","Sept","Oct","Nov","Dec"],templateType:"popup",showTodayButton:!1,closeOnSelect:!1,disableWeekdays:[]};this.configDatePicker=function(n){angular.extend(e,n)},this.$get=["$rootScope","$ionicPopup","$ionicModal","IonicDatepickerService",function(n,t,a,o){function i(e){return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function c(e){e.disabledDates&&0!==e.disabledDates.length?(u.disabledDates=[],angular.forEach(e.disabledDates,function(e,n){e=i(new Date(e)),u.disabledDates.push(e.getTime())})):u.disabledDates=[]}function d(e){e=i(e),u.currentDate=angular.copy(e);var n=new Date(e.getFullYear(),e.getMonth(),1).getDate(),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();u.monthsList=[],u.mainObj.monthsList&&12===u.mainObj.monthsList.length?u.monthsList=u.mainObj.monthsList:u.monthsList=o.monthsList,u.yearsList=o.getYearsList(u.mainObj.from,u.mainObj.to),u.dayList=[];var a,c;u.firstDayEpoch=i(new Date(e.getFullYear(),e.getMonth(),n)).getTime(),u.lastDayEpoch=i(new Date(e.getFullYear(),e.getMonth(),t)).getTime();for(var d=n;t>=d;d++)a=new Date(e.getFullYear(),e.getMonth(),d),c=a.getTime()u.toDate||u.mainObj.disableWeekdays.indexOf(a.getDay())>=0,u.dayList.push({date:a.getDate(),month:a.getMonth(),year:a.getFullYear(),day:a.getDay(),epoch:a.getTime(),disabled:c});var r=u.dayList[0].day-u.mainObj.mondayFirst;r=0>r?6:r;for(var p=0;r>p;p++)u.dayList.unshift({});u.rows=[0,7,14,21,28,35],u.cols=[0,1,2,3,4,5,6],u.data.currentMonth=u.mainObj.monthsList[e.getMonth()],u.data.currentYear=e.getFullYear(),u.data.currentMonthSelected=angular.copy(u.data.currentMonth),u.currentYearSelected=angular.copy(u.data.currentYear),u.numColumns=7}function r(e){u.mainObj=angular.copy(e),u.selctedDateEpoch=i(u.mainObj.inputDate).getTime(),u.mainObj.weeksList&&7===u.mainObj.weeksList.length?u.weeksList=u.mainObj.weeksList:u.weeksList=["S","M","T","W","T","F","S"],u.mainObj.mondayFirst&&u.weeksList.push(u.mainObj.weeksList.shift()),u.disableWeekdays=u.mainObj.disableWeekdays,d(u.mainObj.inputDate),c(u.mainObj)}function p(){u.modal.show()}function l(){u.modal.hide()}var s={},u=n.$new();return u.today=i(new Date).getTime(),u.disabledDates=[],u.data={},u.prevMonth=function(){1===u.currentDate.getMonth()&&u.currentDate.setFullYear(u.currentDate.getFullYear()),u.currentDate.setMonth(u.currentDate.getMonth()-1),u.data.currentMonth=u.mainObj.monthsList[u.currentDate.getMonth()],u.data.currentYear=u.currentDate.getFullYear(),d(u.currentDate)},u.nextMonth=function(){11===u.currentDate.getMonth()&&u.currentDate.setFullYear(u.currentDate.getFullYear()),u.currentDate.setDate(1),u.currentDate.setMonth(u.currentDate.getMonth()+1),u.data.currentMonth=u.mainObj.monthsList[u.currentDate.getMonth()],u.data.currentYear=u.currentDate.getFullYear(),d(u.currentDate)},u.dateSelected=function(e){e&&0!==Object.keys(e).length&&(u.selctedDateEpoch=e.epoch,u.mainObj.closeOnSelect&&(u.mainObj.callback(u.selctedDateEpoch),"popup"==u.mainObj.templateType.toLowerCase()?u.popup.close():l()))},u.setIonicDatePickerTodayDate=function(){var e=new Date;d(new Date),u.selctedDateEpoch=i(e).getTime(),u.mainObj.closeOnSelect&&(u.mainObj.callback(u.selctedDateEpoch),l())},u.setIonicDatePickerDate=function(){u.mainObj.callback(u.selctedDateEpoch),l()},u.monthChanged=function(e){var n=u.monthsList.indexOf(e);u.currentDate.setMonth(n),d(u.currentDate)},u.yearChanged=function(e){u.currentDate.setFullYear(e),d(u.currentDate)},a.fromTemplateUrl("ionic-datepicker-modal.html",{scope:u,animation:"slide-in-up"}).then(function(e){u.modal=e}),u.$on("$destroy",function(){u.modal.remove()}),u.closeIonicDatePickerModal=function(){l()},s.openDatePicker=function(n){var a=[];delete u.fromDate,delete u.toDate,u.mainObj=angular.extend({},e,n),u.mainObj.from&&(u.fromDate=i(new Date(u.mainObj.from)).getTime()),u.mainObj.to&&(u.toDate=i(new Date(u.mainObj.to)).getTime()),n.disableWeekdays&&e.disableWeekdays&&(u.mainObj.disableWeekdays=n.disableWeekdays.concat(e.disableWeekdays)),r(u.mainObj),u.mainObj.closeOnSelect||(a=[{text:u.mainObj.setLabel,type:"button_set",onTap:function(e){u.mainObj.callback(u.selctedDateEpoch)}}]),u.mainObj.showTodayButton&&a.push({text:u.mainObj.todayLabel,type:"button_today",onTap:function(e){var n=new Date;d(new Date),u.selctedDateEpoch=i(n).getTime(),u.mainObj.closeOnSelect||e.preventDefault()}}),a.push({text:u.mainObj.closeLabel,type:"button_close",onTap:function(e){console.log("ionic-datepicker popup closed.")}}),"popup"==u.mainObj.templateType.toLowerCase()?u.popup=t.show({templateUrl:"ionic-datepicker-popup.html",scope:u,cssClass:"ionic_datepicker_popup",buttons:a}):p()},s}]}),angular.module("ionic-datepicker.service",[]).service("IonicDatepickerService",function(){this.monthsList=["January","February","March","April","May","June","July","August","September","October","November","December"],this.getYearsList=function(e,n){var t=[],a=1900,o=2100;a=e?new Date(e).getFullYear():a,o=n?new Date(n).getFullYear():o;for(var i=a;o>=i;i++)t.push(i);return t}}); \ No newline at end of file diff --git a/src/ionic-datepicker-popup.html b/src/ionic-datepicker-popup.html index 428d785f..1186506d 100644 --- a/src/ionic-datepicker-popup.html +++ b/src/ionic-datepicker-popup.html @@ -1,13 +1,13 @@
{{selctedDateEpoch | date : mainObj.dateFormat}}
-
+
-
+
-
+