From 2cf1f95714c4dc85cba753ffe4cb4ff57dd13282 Mon Sep 17 00:00:00 2001 From: Kamil Date: Thu, 20 Mar 2014 13:26:19 +0100 Subject: [PATCH] Parenthesis change. --- build/angular-date-range-picker.js | 2 +- build/angular-date-range-picker.min.js | 4 ++-- src/angular-date-range-picker.coffee | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/build/angular-date-range-picker.js b/build/angular-date-range-picker.js index dce6a77..ed883de 100644 --- a/build/angular-date-range-picker.js +++ b/build/angular-date-range-picker.js @@ -4,7 +4,7 @@ angular.module("dateRangePicker").directive("dateRangePicker", [ "$compile", function($compile) { var CUSTOM, pickerTemplate; - pickerTemplate = "
\n
\n \n
\n
\n \n \n \n \n \n \n \n \n
\n
\n
\n \n
\n
\n
\n Select range: \n
\n
\n \n cancel\n
\n
\n
"; + pickerTemplate = "
\n
\n \n
\n
\n \n \n \n \n \n \n \n \n
\n
\n
\n \n
\n
\n
\n Select range: \n
\n
\n \n cancel\n
\n
\n
"; CUSTOM = "CUSTOM"; return { restrict: "AE", diff --git a/build/angular-date-range-picker.min.js b/build/angular-date-range-picker.min.js index bfd4397..fd0aca4 100644 --- a/build/angular-date-range-picker.min.js +++ b/build/angular-date-range-picker.min.js @@ -1,2 +1,2 @@ -/*! angular-date-range-picker 2014-03-17 */ -(function(){angular.module("dateRangePicker",["pasvaz.bindonce"]),angular.module("dateRangePicker").directive("dateRangePicker",["$compile",function(a){var b,c;return c='
\n
\n \n
\n
\n \n \n \n \n \n \n \n \n
\n
\n
\n \n
\n
\n
\n Select range: \n
\n
\n \n cancel\n
\n
\n
',b="CUSTOM",{restrict:"AE",replace:!0,template:'\n \n {{ model.start.format("ll") }} - {{ model.end.format("ll") }}\n Select date range\n \n \n {{ model.format("ll") }}\n Select date\n \n',scope:{model:"=ngModel",customSelectOptions:"=",ranged:"="},link:function(d,e){var f,g,h,i,j,k;return d.quickListDefinitions=d.customSelectOptions,null==d.quickListDefinitions&&(d.quickListDefinitions=[{label:"This week",range:moment().range(moment().startOf("week").startOf("day"),moment().endOf("week").startOf("day"))},{label:"Next week",range:moment().range(moment().startOf("week").add(1,"week").startOf("day"),moment().add(1,"week").endOf("week").startOf("day"))},{label:"This fortnight",range:moment().range(moment().startOf("week").startOf("day"),moment().add(1,"week").endOf("week").startOf("day"))},{label:"This month",range:moment().range(moment().startOf("month").startOf("day"),moment().endOf("month").startOf("day"))},{label:"Next month",range:moment().range(moment().startOf("month").add(1,"month").startOf("day"),moment().add(1,"month").endOf("month").startOf("day"))}]),d.quick=null,d.range=null,d.selecting=!1,d.visible=!1,d.start=null,d.showRanged=void 0===d.ranged?!0:d.ranged,j=function(a){var c,e,f,g,h;if(null==a&&(a=!1),d.showRanged){for(d.quickList=[],a&&d.quickList.push({label:"Custom",range:b}),g=d.quickListDefinitions,h=[],e=0,f=g.length;f>e;e++)c=g[e],h.push(d.quickList.push(c));return h}},h=function(){var a,b;return d.showRanged?d.range=d.selection?(b=d.selection.start.clone().startOf("month").startOf("day"),a=b.clone().add(2,"months").endOf("month").startOf("day"),moment().range(b,a)):moment().range(moment().startOf("month").subtract(1,"month").startOf("day"),moment().endOf("month").add(1,"month").startOf("day")):(d.selection=!1,d.selection=d.model||!1,d.date=d.model||moment(),d.range=moment().range(moment(d.date).startOf("month"),moment(d.date).endOf("month")))},i=function(){var a,c,e,f;if(d.showRanged&&d.selection){for(f=d.quickList,c=0,e=f.length;e>c;c++)if(a=f[c],a.range!==b&&d.selection.start.startOf("day").unix()===a.range.start.startOf("day").unix()&&d.selection.end.startOf("day").unix()===a.range.end.startOf("day").unix())return d.quick=a.range,void j();return d.quick=b,j(!0)}},k=function(){var a,b,c,e,f,g;for(d.months=[],c=12*d.range.start.year()+d.range.start.month(),b=moment().startOf("week").day(),d.range.by("days",function(a){var e,f,g,h,i,j,k;return e=a.day()-b,0>e&&(e=7+e),g=12*a.year()+a.month()-c,i=parseInt((7+a.date()-e)/7),h=!1,f=!1,d.showRanged?d.start?(h=a===d.start,f=ae;e++)a=g[e],a.weeks[0]||a.weeks.splice(0,1);return i()},d.show=function(){return d.selection=d.model,h(),k(),d.visible=!0},d.hide=function(a){return null!=a&&"function"==typeof a.stopPropagation&&a.stopPropagation(),d.visible=!1,d.start=null},d.prevent_select=function(a){return null!=a&&"function"==typeof a.stopPropagation?a.stopPropagation():void 0},d.ok=function(a){return null!=a&&"function"==typeof a.stopPropagation&&a.stopPropagation(),d.model=d.selection,d.hide()},d.select=function(a,b){return null!=b&&"function"==typeof b.stopPropagation&&b.stopPropagation(),a.disabled?void 0:(d.showRanged?(d.selecting=!d.selecting,d.selecting?d.start=a.date:(d.selection=moment().range(d.start,a.date),d.start=null)):d.selection=a.date,k())},d.move=function(a,b){return null!=b&&"function"==typeof b.stopPropagation&&b.stopPropagation(),d.showRanged?d.range=moment().range(d.range.start.add(a,"months").startOf("month").startOf("day"),d.range.start.clone().add(2,"months").endOf("month").startOf("day")):(d.date=moment().month(d.date.month()+a),d.range=moment().range(moment(d.date).startOf("month"),moment(d.date).endOf("month"))),k()},d.handlePickerClick=function(a){return null!=a&&"function"==typeof a.stopPropagation?a.stopPropagation():void 0},d.$watch("quick",function(a){return a&&a!==b?(d.selection=d.quick,d.selecting=!1,d.start=null,h(),k()):void 0}),d.$watch("customSelectOptions",function(a){return"undefined"!=typeof customSelectOptions&&null!==customSelectOptions?d.quickListDefinitions=a:void 0}),g=a(angular.element(c))(d),e.append(g),e.bind("click",function(a){return null!=a&&"function"==typeof a.stopPropagation&&a.stopPropagation(),d.$apply(function(){return d.visible?d.hide():d.show()})}),f=function(){return d.$apply(function(){return d.hide()}),!0},angular.element(document).bind("click",f),d.$on("$destroy",function(){return angular.element(document).unbind("click",f)}),j(),h(),k()}}}])}).call(this); \ No newline at end of file +/*! angular-date-range-picker 2014-03-20 */ +(function(){angular.module("dateRangePicker",["pasvaz.bindonce"]),angular.module("dateRangePicker").directive("dateRangePicker",["$compile",function(a){var b,c;return c='
\n
\n \n
\n
\n \n \n \n \n \n \n \n \n
\n
\n
\n \n
\n
\n
\n Select range: \n
\n
\n \n cancel\n
\n
\n
',b="CUSTOM",{restrict:"AE",replace:!0,template:'\n \n {{ model.start.format("ll") }} - {{ model.end.format("ll") }}\n Select date range\n \n \n {{ model.format("ll") }}\n Select date\n \n',scope:{model:"=ngModel",customSelectOptions:"=",ranged:"="},link:function(d,e){var f,g,h,i,j,k;return d.quickListDefinitions=d.customSelectOptions,null==d.quickListDefinitions&&(d.quickListDefinitions=[{label:"This week",range:moment().range(moment().startOf("week").startOf("day"),moment().endOf("week").startOf("day"))},{label:"Next week",range:moment().range(moment().startOf("week").add(1,"week").startOf("day"),moment().add(1,"week").endOf("week").startOf("day"))},{label:"This fortnight",range:moment().range(moment().startOf("week").startOf("day"),moment().add(1,"week").endOf("week").startOf("day"))},{label:"This month",range:moment().range(moment().startOf("month").startOf("day"),moment().endOf("month").startOf("day"))},{label:"Next month",range:moment().range(moment().startOf("month").add(1,"month").startOf("day"),moment().add(1,"month").endOf("month").startOf("day"))}]),d.quick=null,d.range=null,d.selecting=!1,d.visible=!1,d.start=null,d.showRanged=void 0===d.ranged?!0:d.ranged,j=function(a){var c,e,f,g,h;if(null==a&&(a=!1),d.showRanged){for(d.quickList=[],a&&d.quickList.push({label:"Custom",range:b}),g=d.quickListDefinitions,h=[],e=0,f=g.length;f>e;e++)c=g[e],h.push(d.quickList.push(c));return h}},h=function(){var a,b;return d.showRanged?d.range=d.selection?(b=d.selection.start.clone().startOf("month").startOf("day"),a=b.clone().add(2,"months").endOf("month").startOf("day"),moment().range(b,a)):moment().range(moment().startOf("month").subtract(1,"month").startOf("day"),moment().endOf("month").add(1,"month").startOf("day")):(d.selection=!1,d.selection=d.model||!1,d.date=d.model||moment(),d.range=moment().range(moment(d.date).startOf("month"),moment(d.date).endOf("month")))},i=function(){var a,c,e,f;if(d.showRanged&&d.selection){for(f=d.quickList,c=0,e=f.length;e>c;c++)if(a=f[c],a.range!==b&&d.selection.start.startOf("day").unix()===a.range.start.startOf("day").unix()&&d.selection.end.startOf("day").unix()===a.range.end.startOf("day").unix())return d.quick=a.range,void j();return d.quick=b,j(!0)}},k=function(){var a,b,c,e,f,g;for(d.months=[],c=12*d.range.start.year()+d.range.start.month(),b=moment().startOf("week").day(),d.range.by("days",function(a){var e,f,g,h,i,j,k;return e=a.day()-b,0>e&&(e=7+e),g=12*a.year()+a.month()-c,i=parseInt((7+a.date()-e)/7),h=!1,f=!1,d.showRanged?d.start?(h=a===d.start,f=ae;e++)a=g[e],a.weeks[0]||a.weeks.splice(0,1);return i()},d.show=function(){return d.selection=d.model,h(),k(),d.visible=!0},d.hide=function(a){return null!=a&&"function"==typeof a.stopPropagation&&a.stopPropagation(),d.visible=!1,d.start=null},d.prevent_select=function(a){return null!=a&&"function"==typeof a.stopPropagation?a.stopPropagation():void 0},d.ok=function(a){return null!=a&&"function"==typeof a.stopPropagation&&a.stopPropagation(),d.model=d.selection,d.hide()},d.select=function(a,b){return null!=b&&"function"==typeof b.stopPropagation&&b.stopPropagation(),a.disabled?void 0:(d.showRanged?(d.selecting=!d.selecting,d.selecting?d.start=a.date:(d.selection=moment().range(d.start,a.date),d.start=null)):d.selection=a.date,k())},d.move=function(a,b){return null!=b&&"function"==typeof b.stopPropagation&&b.stopPropagation(),d.showRanged?d.range=moment().range(d.range.start.add(a,"months").startOf("month").startOf("day"),d.range.start.clone().add(2,"months").endOf("month").startOf("day")):(d.date=moment().month(d.date.month()+a),d.range=moment().range(moment(d.date).startOf("month"),moment(d.date).endOf("month"))),k()},d.handlePickerClick=function(a){return null!=a&&"function"==typeof a.stopPropagation?a.stopPropagation():void 0},d.$watch("quick",function(a){return a&&a!==b?(d.selection=d.quick,d.selecting=!1,d.start=null,h(),k()):void 0}),d.$watch("customSelectOptions",function(a){return"undefined"!=typeof customSelectOptions&&null!==customSelectOptions?d.quickListDefinitions=a:void 0}),g=a(angular.element(c))(d),e.append(g),e.bind("click",function(a){return null!=a&&"function"==typeof a.stopPropagation&&a.stopPropagation(),d.$apply(function(){return d.visible?d.hide():d.show()})}),f=function(){return d.$apply(function(){return d.hide()}),!0},angular.element(document).bind("click",f),d.$on("$destroy",function(){return angular.element(document).unbind("click",f)}),j(),h(),k()}}}])}).call(this); \ No newline at end of file diff --git a/src/angular-date-range-picker.coffee b/src/angular-date-range-picker.coffee index 5629a93..e6d2e98 100644 --- a/src/angular-date-range-picker.coffee +++ b/src/angular-date-range-picker.coffee @@ -3,9 +3,7 @@ angular.module "dateRangePicker", ['pasvaz.bindonce'] angular.module("dateRangePicker").directive "dateRangePicker", ["$compile", ($compile) -> # constants pickerTemplate = """ -
+