From bece914d434586e2e81f227d099b7c044e0d174f Mon Sep 17 00:00:00 2001 From: Kamil Date: Fri, 4 Jul 2014 11:37:34 +0200 Subject: [PATCH] [fix] options -> .options --- bower.json | 5 +++-- build/angular-mighty-datepicker.js | 8 ++++---- package.json | 5 +++-- src/angular-mighty-datepicker.coffee | 4 ++-- test/index.html | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/bower.json b/bower.json index 2bb97e6..0c2c7e7 100644 --- a/bower.json +++ b/bower.json @@ -1,9 +1,10 @@ { "name": "angular-mighty-datepicker", - "version": "0.0.3", + "version": "0.0.4", "authors": [ "Krzysztof Jung ", - "Patryk Peas " + "Patryk Peas ", + "Kamil Nicieja " ], "repository": "git://github.com/monterail/angular-mighty-datepicker.git", "description": "Angular based datepicker with mighty options", diff --git a/build/angular-mighty-datepicker.js b/build/angular-mighty-datepicker.js index 71b5e73..be84911 100644 --- a/build/angular-mighty-datepicker.js +++ b/build/angular-mighty-datepicker.js @@ -39,11 +39,11 @@ _withinLimits = function(day, month) { var withinLimits; withinLimits = true; - if (options.before) { - withinLimits && (withinLimits = day.isBefore(options.before)); + if ($scope.options.before) { + withinLimits && (withinLimits = day.isBefore($scope.options.before)); } - if (options.after) { - withinLimits && (withinLimits = day.isAfter(options.after)); + if ($scope.options.after) { + withinLimits && (withinLimits = day.isAfter($scope.options.after)); } return withinLimits; }; diff --git a/package.json b/package.json index e082bfa..e240673 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "angular-mighty-datepicker", - "version": "0.0.3", + "version": "0.0.4", "authors": [ "Krzysztof Jung ", - "Patryk Peas " + "Patryk Peas ", + "Kamil Nicieja " ], "repository": "git://github.com/monterail/angular-mighty-datepicker.git", "description": "Angular based datepicker with mighty options", diff --git a/src/angular-mighty-datepicker.coffee b/src/angular-mighty-datepicker.coffee index 26fe8a5..662c7ec 100644 --- a/src/angular-mighty-datepicker.coffee +++ b/src/angular-mighty-datepicker.coffee @@ -57,8 +57,8 @@ angular.module("mightyDatepicker").directive "mightyDatepicker", ($compile) -> _withinLimits = (day, month) -> withinLimits = true - withinLimits &&= day.isBefore(options.before) if options.before - withinLimits &&= day.isAfter(options.after) if options.after + withinLimits &&= day.isBefore($scope.options.before) if $scope.options.before + withinLimits &&= day.isAfter($scope.options.after) if $scope.options.after withinLimits _isSelected = (day) -> diff --git a/test/index.html b/test/index.html index 63b983e..1f7a9ca 100644 --- a/test/index.html +++ b/test/index.html @@ -17,7 +17,7 @@ } $scope.date = null; $scope.multi = []; - $scope.options = {start: moment().add('month', -1), months: 1, after: moment()} + $scope.options = {months: 1, after: moment()} $scope.optionsM = {start: moment().add('month', -1), months: 3, mode: "multiple", after: moment()} });