From 4892b0c4fa7cd34b676642712fc810736674cb9a Mon Sep 17 00:00:00 2001 From: Marcolino Date: Thu, 9 Jun 2016 16:04:36 +0200 Subject: [PATCH 01/17] Added firstWeekDayIsMonday option Added new option 'firstWeekDayIsMonday' to handle locales using Moday as the first day of week --- src/angular-mighty-datepicker.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/angular-mighty-datepicker.coffee b/src/angular-mighty-datepicker.coffee index 2cfe2da..01a415e 100644 --- a/src/angular-mighty-datepicker.coffee +++ b/src/angular-mighty-datepicker.coffee @@ -53,6 +53,8 @@ angular.module("mightyDatepicker").directive "mightyDatepicker", ["$compile", ($ callback: undefined markerTemplate: "{{ day.marker }}" template: pickerTemplate + firstWeekDayIsMonday: 0 + restrict: "AE" replace: true template: '
' @@ -111,7 +113,8 @@ angular.module("mightyDatepicker").directive "mightyDatepicker", ["$compile", ($ days = [] filter = true start = time.startOf('week') - days = [0 .. 6].map (d) -> + week = if $scope.options['firstWeekDayIsMonday'] then [1 .. 6, 0] else [0 .. 6] + days = week.map (d) -> day = moment(start).add(d, 'days') withinMonth = day.month() == month withinLimits = _withinLimits(day, month) From ef455059a7dcf1964e7eda186672e7fb2c2a01c6 Mon Sep 17 00:00:00 2001 From: Marcolino Date: Sun, 12 Jun 2016 20:08:25 +0200 Subject: [PATCH 02/17] added broadcast event handling to reload --- src/angular-mighty-datepicker.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/angular-mighty-datepicker.coffee b/src/angular-mighty-datepicker.coffee index 01a415e..e2d8ad4 100644 --- a/src/angular-mighty-datepicker.coffee +++ b/src/angular-mighty-datepicker.coffee @@ -149,6 +149,8 @@ angular.module("mightyDatepicker").directive "mightyDatepicker", ["$compile", ($ $scope.options = tempOptions + $scope.$on('mighty-datepicker-reload' -> _prepare(); + switch $scope.options.mode when "multiple" # add start based on model From 1cafbbc074461c793f7c73e64494ada0fbc002dc Mon Sep 17 00:00:00 2001 From: Marcolino Date: Sun, 12 Jun 2016 20:20:51 +0200 Subject: [PATCH 03/17] Update README.md added broadcast event handling to reload calendar --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 4fc2738..88ddd8c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ ## Changelog: +0.1.5 +- added broadcast event handling to reload calendar + 0.1.4 - fix problem with selecting 1 day in range picker From 609253fff7693b3cdfea4ddf6119f4ca25cb9a98 Mon Sep 17 00:00:00 2001 From: Marcolino Date: Sun, 12 Jun 2016 20:22:09 +0200 Subject: [PATCH 04/17] Update package.json --- package.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0466eea..f48b0ff 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { "name": "angular-mighty-datepicker", - "version": "0.1.4", + "version": "0.1.5", "authors": [ "Krzysztof Jung ", "Patryk Peas ", "Kamil Nicieja ", - "Bartosz Erbert " + "Bartosz Erbert ", + "Marco Solari " ], - "repository": "git://github.com/monterail/angular-mighty-datepicker.git", + "repository": "git://github.com/marcolinoangular-mighty-datepicker.git", "description": "Angular based datepicker with mighty options", "main": "build/angular-mighty-datepicker.js", "devDependencies": { @@ -32,7 +33,7 @@ "datepicker" ], "license": "MIT", - "homepage": "http://github.com/monterail/angular-mighty-datepicker", + "homepage": "http://github.com/marcolino/angular-mighty-datepicker", "ignore": [ "**/.*", "node_modules", From 0f96aba3be55a7d6515436fcc59c65276ae40840 Mon Sep 17 00:00:00 2001 From: Marcolino Date: Sun, 12 Jun 2016 20:33:46 +0200 Subject: [PATCH 05/17] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f48b0ff..c3ffc68 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "angular-mighty-datepicker", + "name": "angular-mighty2-datepicker", "version": "0.1.5", "authors": [ "Krzysztof Jung ", From 6b32cd0f33db48fd549fb4a87e7e08ea0b69242b Mon Sep 17 00:00:00 2001 From: marcolino Date: Sun, 12 Jun 2016 21:41:58 +0200 Subject: [PATCH 06/17] compiled angular-mighty-datepicker.coffee --- build/angular-mighty-datepicker.js | 489 ++++++++++++++------------- src/angular-mighty-datepicker.coffee | 27 +- 2 files changed, 266 insertions(+), 250 deletions(-) diff --git a/build/angular-mighty-datepicker.js b/build/angular-mighty-datepicker.js index ded1d0b..d6469c3 100644 --- a/build/angular-mighty-datepicker.js +++ b/build/angular-mighty-datepicker.js @@ -1,277 +1,282 @@ (function() { + var options, pickerTemplate; + angular.module("mightyDatepicker", ["pasvaz.bindonce"]); angular.module("mightyDatepicker").directive("mightyDatepicker", [ - "$compile", function($compile) { - var options, pickerTemplate; - pickerTemplate = "
\n \n
\n
\n \n \n \n \n \n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
"; - options = { - mode: "simple", - months: 1, - start: null, - filter: void 0, - callback: void 0, - markerTemplate: "{{ day.marker }}", - template: pickerTemplate - }; - return { - restrict: "AE", - replace: true, - template: '
', - scope: { - model: '=ngModel', - options: '=', - markers: '=', - after: '=', - before: '=', - rangeFrom: '=', - rangeTo: '=' - }, - link: function($scope, $element, $attrs) { - var _bake, _build, _buildMonth, _buildWeek, _getMarker, _indexMarkers, _indexOfMoment, _isInRange, _isSelected, _prepare, _setup, _withinLimits; - _bake = function() { - var domEl; - domEl = $compile(angular.element($scope.options.template))($scope); - return $element.append(domEl); - }; - _indexOfMoment = function(array, element, match) { - var key, value; - for (key in array) { - value = array[key]; - if (element.isSame(value, match)) { - return key; - } - } - return -1; - }; - _indexMarkers = function() { - var marker; - if ($scope.markers) { - return $scope.markerIndex = (function() { - var _i, _len, _ref, _results; - _ref = $scope.markers; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - marker = _ref[_i]; - _results.push(marker.day); - } - return _results; - })(); + "$compile", function($compile) {}, pickerTemplate = "
\n \n
\n
\n \n \n \n \n \n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
", options = { + mode: "simple", + months: 1, + start: null, + filter: void 0, + callback: void 0, + markerTemplate: "{{ day.marker }}", + template: pickerTemplate, + firstWeekDayIsMonday: 0 + }, { + restrict: "AE", + replace: true, + template: '
', + scope: { + model: '=ngModel', + options: '=', + markers: '=', + after: '=', + before: '=', + rangeFrom: '=', + rangeTo: '=' + }, + link: function($scope, $element, $attrs) { + var _bake, _build, _buildMonth, _buildWeek, _getMarker, _indexMarkers, _indexOfMoment, _isInRange, _isSelected, _prepare, _setup, _withinLimits; + _bake = function() { + var domEl; + domEl = $compile(angular.element($scope.options.template))($scope); + return $element.append(domEl); + }; + _indexOfMoment = function(array, element, match) { + var key, value; + for (key in array) { + value = array[key]; + if (element.isSame(value, match)) { + return key; } - }; - _withinLimits = function(day, month) { - var withinLimits; - withinLimits = true; - if ($scope.before) { - withinLimits && (withinLimits = day.isSameOrBefore($scope.before, 'day')); - } - if ($scope.after) { - withinLimits && (withinLimits = day.isSameOrAfter($scope.after, 'day')); + } + return -1; + }; + _indexMarkers = function() { + var marker; + return $scope.markerIndex = $scope.markers ? (function() { + var _i, _len, _ref, _results; + _ref = $scope.markers; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + marker = _ref[_i]; + _results.push(marker.day); } - return withinLimits; - }; - _getMarker = function(day) { - var ix; - ix = _indexOfMoment($scope.markerIndex, day, 'day'); - if (ix > -1) { - return $scope.markers[ix].marker; + return _results; + })() : void 0; + }; + _withinLimits = function(day, month) { + var withinLimits; + withinLimits = true; + if ($scope.before) { + withinLimits && (withinLimits = day.isSameOrBefore($scope.before, 'day')); + } + if ($scope.after) { + withinLimits && (withinLimits = day.isSameOrAfter($scope.after, 'day')); + } + return withinLimits; + }; + _getMarker = function(day) { + var ix; + ix = _indexOfMoment($scope.markerIndex, day, 'day'); + if (ix > -1) { + return $scope.markers[ix].marker; + } else { + return void 0; + } + }; + _isSelected = function(day) { + switch ($scope.options.mode) { + case "multiple": + return _indexOfMoment($scope.model, day, 'day') > -1; + default: + return $scope.model && day.isSame($scope.model, 'day'); + } + }; + _isInRange = function(day) { + if ($scope.options.rangeMode) { + if ($scope.options.rangeMode === "from") { + return; + return moment.range($scope.model, $scope.before).contains(day) || day.isSame($scope.before, 'day'); } else { - return void 0; - } - }; - _isSelected = function(day) { - switch ($scope.options.mode) { - case "multiple": - return _indexOfMoment($scope.model, day, 'day') > -1; - default: - return $scope.model && day.isSame($scope.model, 'day'); + return; + return moment.range($scope.after, $scope.model).contains(day) || day.isSame($scope.after, 'day'); } - }; - _isInRange = function(day) { - if ($scope.options.rangeMode) { - if ($scope.options.rangeMode === "from") { - return moment.range($scope.model, $scope.before).contains(day) || day.isSame($scope.before, 'day'); - } else { - return moment.range($scope.after, $scope.model).contains(day) || day.isSame($scope.after, 'day'); - } - } else { - return false; + } else { + return false; + } + }; + _buildWeek = function(time, month) { + var days, filter, start, week; + days = []; + filter = true; + start = time.startOf('week'); + week = $scope.options['firstWeekDayIsMonday'] ? [1, 2, 3, 4, 5, 6] : [0, 1, 2, 3, 4, 5, 6]; + days = week.map(function(d) { + var day, withinLimits, withinMonth; + day = moment(start).add(d, 'days'); + withinMonth = day.month() === month; + withinLimits = _withinLimits(day, month); + if ($scope.options.filter) { + filter = $scope.options.filter(day); } - }; - _buildWeek = function(time, month) { - var days, filter, start; - days = []; - filter = true; - start = time.startOf('week'); - days = [0, 1, 2, 3, 4, 5, 6].map(function(d) { - var day, withinLimits, withinMonth; - day = moment(start).add(d, 'days'); - withinMonth = day.month() === month; - withinLimits = _withinLimits(day, month); - if ($scope.options.filter) { - filter = $scope.options.filter(day); - } - return { - date: day, - selected: _isSelected(day) && withinMonth, - inRange: _isInRange(day), - disabled: !(withinLimits && withinMonth && filter), - marker: withinMonth ? _getMarker(day) : void 0 - }; - }); - return days; - }; - _buildMonth = function(time) { - var calendarEnd, calendarStart, start, w, weeks, weeksInMonth; - weeks = []; - calendarStart = moment(time).startOf('month'); - calendarEnd = moment(time).endOf('month'); - weeksInMonth = 5; - start = time.startOf('month'); - weeks = (function() { - var _i, _results; - _results = []; - for (w = _i = 0; 0 <= weeksInMonth ? _i <= weeksInMonth : _i >= weeksInMonth; w = 0 <= weeksInMonth ? ++_i : --_i) { - _results.push(_buildWeek(moment(start).add(w, 'weeks'), moment(start).month())); - } - return _results; - })(); return { - weeks: weeks, - name: time.format("MMMM YYYY") + date: day, + selected: _isSelected(day) && withinMonth, + inRange: _isInRange(day), + disabled: !(withinLimits && withinMonth && filter), + marker: withinMonth ? _getMarker(day) : void 0 }; + }); + return days; + }; + _buildMonth = function(time) { + var calendarEnd, calendarStart, start, w, weeks, weeksInMonth; + weeks = []; + calendarStart = moment(time).startOf('month'); + calendarEnd = moment(time).endOf('month'); + weeksInMonth = 5; + start = time.startOf('month'); + weeks = (function() { + var _i, _results; + _results = []; + for (w = _i = 0; 0 <= weeksInMonth ? _i <= weeksInMonth : _i >= weeksInMonth; w = 0 <= weeksInMonth ? ++_i : --_i) { + _results.push(_buildWeek(moment(start).add(w, 'weeks'), moment(start).month())); + } + return _results; + })(); + return { + weeks: weeks, + name: time.format("MMMM YYYY") }; - _setup = function() { - var attr, dates, start, tempOptions, v, _ref; - tempOptions = {}; - for (attr in options) { - v = options[attr]; - tempOptions[attr] = v; + }; + _setup = function() { + var attr, dates, start, tempOptions, v, _ref; + tempOptions = {}; + for (attr in options) { + v = options[attr]; + tempOptions[attr] = v; + } + if ($scope.options) { + _ref = $scope.options; + for (attr in _ref) { + v = _ref[attr]; + tempOptions[attr] = $scope.options[attr]; } - if ($scope.options) { - _ref = $scope.options; - for (attr in _ref) { - v = _ref[attr]; - tempOptions[attr] = $scope.options[attr]; + } + $scope.options = tempOptions; + $scope.$on('mighty-datepicker-reload')(function() { + return _prepare(); + }); + switch ($scope.options.mode) { + case "multiple": + if ($scope.model && Array.isArray($scope.model) && $scope.model.length > 0) { + if ($scope.model.length === 1) { + start = moment($scope.model[0]); + } else { + dates = $scope.model.slice(0); + start = moment(dates.sort().slice(-1)[0]); + } + } else { + $scope.model = []; } + break; + default: + if ($scope.model) { + start = moment($scope.model); + } + } + $scope.options.start = $scope.options.start || start || moment().startOf('day'); + if ($scope.rangeFrom) { + $scope.options.rangeMode = "from"; + } else if ($scope.rangeTo) { + $scope.options.rangeMode = "to"; + } + _indexMarkers(); + return $scope.options.template = $scope.options.template.replace('ng-bind-template=""', 'ng-bind-template="' + $scope.options.markerTemplate + '"'); + }; + _prepare = function() { + var m; + $scope.months = []; + return $scope.months = (function() { + var _i, _ref, _results; + _results = []; + for (m = _i = 0, _ref = $scope.options.months; 0 <= _ref ? _i < _ref : _i > _ref; m = 0 <= _ref ? ++_i : --_i) { + _results.push(_buildMonth(moment($scope.options.start).add(m, 'months'))); } - $scope.options = tempOptions; + return _results; + })(); + }; + _build = function() { + _prepare(); + return _bake(); + }; + $scope.on('mighty-datepicker-reload')(function() { + return _prepare(); + }); + $scope.moveMonth = function(step) { + $scope.options.start.add(step, 'month'); + _prepare(); + }; + $scope.select = function(day) { + var ix; + if (!day.disabled) { switch ($scope.options.mode) { case "multiple": - if ($scope.model && Array.isArray($scope.model) && $scope.model.length > 0) { - if ($scope.model.length === 1) { - start = moment($scope.model[0]); - } else { - dates = $scope.model.slice(0); - start = moment(dates.sort().slice(-1)[0]); - } + if (day.selected) { + ix = _indexOfMoment($scope.model, day.date, 'day'); + $scope.model.splice(ix, 1); } else { - $scope.model = []; + $scope.model.push(moment(day.date)); } break; default: - if ($scope.model) { - start = moment($scope.model); - } + $scope.model = day.date; } - $scope.options.start = $scope.options.start || start || moment().startOf('day'); - if ($scope.rangeFrom) { - $scope.options.rangeMode = "from"; - } else if ($scope.rangeTo) { - $scope.options.rangeMode = "to"; + if ($scope.options.callback) { + $scope.options.callback(day.date); } - _indexMarkers(); - return $scope.options.template = $scope.options.template.replace('ng-bind-template=""', 'ng-bind-template="' + $scope.options.markerTemplate + '"'); - }; - _prepare = function() { - var m; - $scope.months = []; - return $scope.months = (function() { - var _i, _ref, _results; - _results = []; - for (m = _i = 0, _ref = $scope.options.months; 0 <= _ref ? _i < _ref : _i > _ref; m = 0 <= _ref ? ++_i : --_i) { - _results.push(_buildMonth(moment($scope.options.start).add(m, 'months'))); - } - return _results; - })(); - }; - _build = function() { - _prepare(); - return _bake(); - }; - $scope.moveMonth = function(step) { - $scope.options.start.add(step, 'month'); - _prepare(); - }; - $scope.select = function(day) { - var ix; - if (!day.disabled) { - switch ($scope.options.mode) { - case "multiple": - if (day.selected) { - ix = _indexOfMoment($scope.model, day.date, 'day'); - $scope.model.splice(ix, 1); - } else { - $scope.model.push(moment(day.date)); - } - break; - default: - $scope.model = day.date; - } - if ($scope.options.callback) { - $scope.options.callback(day.date); - } - return _prepare(); - } - }; - $scope.$watchCollection('markers', function(newMarkers, oldMarkers) { - _indexMarkers(); return _prepare(); - }); - _setup(); - _build(); - switch ($scope.options.mode) { - case "multiple": - $scope.$watchCollection('model', function(newVals, oldVals) { - return _prepare(); - }); - break; - case "simple": - $scope.$watch('model', function(newVal, oldVal) { - if (!moment.isMoment(newVal)) { - newVal = moment(newVal); - } - if (!oldVal || oldVal && !newVal.isSame(oldVal, 'day')) { - $scope.model = newVal; - if (oldVal) { - $scope.options.start = moment(newVal); - } - return _prepare(); - } - }); } - $scope.$watch('before', function(newVal, oldVal) { - if (newVal) { + }; + $scope.$watchCollection('markers', function(newMarkers, oldMarkers) { + _indexMarkers(); + return _prepare(); + }); + _setup(); + _build(); + switch ($scope.options.mode) { + case "multiple": + $scope.$watchCollection('model', function(newVals, oldVals) { + return _prepare(); + }); + break; + case "simple": + $scope.$watch('model', function(newVal, oldVal) { if (!moment.isMoment(newVal)) { newVal = moment(newVal); } - if (!newVal.isSame(oldVal, 'day')) { + if (!oldVal || oldVal && !newVal.isSame(oldVal, 'day')) { + $scope.model = newVal; + if (oldVal) { + $scope.options.start = moment(newVal); + } return _prepare(); } + }); + } + $scope.$watch('before', function(newVal, oldVal) { + if (newVal) { + if (!moment.isMoment(newVal)) { + newVal = moment(newVal); } - }); - return $scope.$watch('after', function(newVal, oldVal) { - if (newVal) { - if (!moment.isMoment(newVal)) { - newVal = moment(newVal); - } - if (!newVal.isSame(oldVal, 'day')) { - return _prepare(); - } + if (!newVal.isSame(oldVal, 'day')) { + return _prepare(); } - }); - } - }; + } + }); + return $scope.$watch('after', function(newVal, oldVal) { + if (newVal) { + if (!moment.isMoment(newVal)) { + newVal = moment(newVal); + } + if (!newVal.isSame(oldVal, 'day')) { + return _prepare(); + } + } + }); + } } ]); diff --git a/src/angular-mighty-datepicker.coffee b/src/angular-mighty-datepicker.coffee index e2d8ad4..dd90500 100644 --- a/src/angular-mighty-datepicker.coffee +++ b/src/angular-mighty-datepicker.coffee @@ -1,6 +1,7 @@ angular.module "mightyDatepicker", ["pasvaz.bindonce"] -angular.module("mightyDatepicker").directive "mightyDatepicker", ["$compile", ($compile) -> +angular.module("mightyDatepicker").directive "mightyDatepicker", + ["$compile", ($compile) -> pickerTemplate = """
\n
\n
\n \n \n \n \n \n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
", options = { + "$compile", function($compile) {}, pickerTemplate = "
\n \n
\n
\n \n \n \n \n \n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
", options = { mode: "simple", months: 1, start: null, @@ -46,14 +46,14 @@ _indexMarkers = function() { var marker; return $scope.markerIndex = $scope.markers ? (function() { - var _i, _len, _ref, _results; - _ref = $scope.markers; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - marker = _ref[_i]; - _results.push(marker.day); + var i, len, ref, results; + ref = $scope.markers; + results = []; + for (i = 0, len = ref.length; i < len; i++) { + marker = ref[i]; + results.push(marker.day); } - return _results; + return results; })() : void 0; }; _withinLimits = function(day, month) { @@ -129,12 +129,12 @@ weeksInMonth = 5; start = time.startOf('month'); weeks = (function() { - var _i, _results; - _results = []; - for (w = _i = 0; 0 <= weeksInMonth ? _i <= weeksInMonth : _i >= weeksInMonth; w = 0 <= weeksInMonth ? ++_i : --_i) { - _results.push(_buildWeek(moment(start).add(w, 'weeks'), moment(start).month())); + var i, ref, results; + results = []; + for (w = i = 0, ref = weeksInMonth; 0 <= ref ? i <= ref : i >= ref; w = 0 <= ref ? ++i : --i) { + results.push(_buildWeek(moment(start).add(w, 'weeks'), moment(start).month())); } - return _results; + return results; })(); return { weeks: weeks, @@ -142,16 +142,16 @@ }; }; _setup = function() { - var attr, dates, start, tempOptions, v, _ref; + var attr, dates, ref, start, tempOptions, v; tempOptions = {}; for (attr in options) { v = options[attr]; tempOptions[attr] = v; } if ($scope.options) { - _ref = $scope.options; - for (attr in _ref) { - v = _ref[attr]; + ref = $scope.options; + for (attr in ref) { + v = ref[attr]; tempOptions[attr] = $scope.options[attr]; } } @@ -190,12 +190,12 @@ var m; $scope.months = []; return $scope.months = (function() { - var _i, _ref, _results; - _results = []; - for (m = _i = 0, _ref = $scope.options.months; 0 <= _ref ? _i < _ref : _i > _ref; m = 0 <= _ref ? ++_i : --_i) { - _results.push(_buildMonth(moment($scope.options.start).add(m, 'months'))); + var i, ref, results; + results = []; + for (m = i = 0, ref = $scope.options.months; 0 <= ref ? i < ref : i > ref; m = 0 <= ref ? ++i : --i) { + results.push(_buildMonth(moment($scope.options.start).add(m, 'months'))); } - return _results; + return results; })(); }; _build = function() { diff --git a/src/angular-mighty-datepicker.coffee b/src/angular-mighty-datepicker.coffee index 6688bfb..ab7d12b 100644 --- a/src/angular-mighty-datepicker.coffee +++ b/src/angular-mighty-datepicker.coffee @@ -6,7 +6,7 @@ angular.module("mightyDatepicker").directive "mightyDatepicker",
@@ -42,7 +42,7 @@ angular.module("mightyDatepicker").directive "mightyDatepicker",
""" From df188c2ef8fbf1476a1ceed05fcca66cf2923022 Mon Sep 17 00:00:00 2001 From: Marco Solari Date: Mon, 13 Jun 2016 14:17:05 +0200 Subject: [PATCH 13/17] changed default arrows in default template to use html entities --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a55a95..3de1618 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,14 @@ ## Changelog: -0.1.6 +0.1.7 - changed default arrows in default template to use html entities +0.1.6 +- corrected broadcast event handling to reload calendar + 0.1.5 - added broadcast event handling to reload calendar -- corrected broadcast event handling to reload calendar 0.1.4 - fix problem with selecting 1 day in range picker From ee31b55804d61bd3f43de169a4178634024ea781 Mon Sep 17 00:00:00 2001 From: Marcolino Date: Sat, 18 Jun 2016 10:44:35 +0200 Subject: [PATCH 14/17] Update angular-mighty-datepicker.coffee --- src/angular-mighty-datepicker.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/angular-mighty-datepicker.coffee b/src/angular-mighty-datepicker.coffee index ab7d12b..6ca8a28 100644 --- a/src/angular-mighty-datepicker.coffee +++ b/src/angular-mighty-datepicker.coffee @@ -125,7 +125,7 @@ angular.module("mightyDatepicker").directive "mightyDatepicker", day = moment(start).add(d, 'days') withinMonth = day.month() == month withinLimits = _withinLimits(day, month) - filter = $scope.options.filter(day) if $scope.options.filter + filter = $scope.options.filter(day) if $scope.options.filter && withinMonth date: day selected: _isSelected(day) && withinMonth inRange: _isInRange(day) From bb351af0cacf7525bab9a2c064029925d3fd4326 Mon Sep 17 00:00:00 2001 From: Marcolino Date: Sat, 18 Jun 2016 10:45:27 +0200 Subject: [PATCH 15/17] Update angular-mighty-datepicker.js --- build/angular-mighty-datepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/angular-mighty-datepicker.js b/build/angular-mighty-datepicker.js index 4cf18e9..769f19c 100644 --- a/build/angular-mighty-datepicker.js +++ b/build/angular-mighty-datepicker.js @@ -108,7 +108,7 @@ day = moment(start).add(d, 'days'); withinMonth = day.month() === month; withinLimits = _withinLimits(day, month); - if ($scope.options.filter) { + if ($scope.options.filter && withinMonth) { filter = $scope.options.filter(day); } return { From 0460365bb9c323712a47896fe32ee19989a394ed Mon Sep 17 00:00:00 2001 From: Marco Solari Date: Fri, 1 Jul 2016 14:36:11 +0200 Subject: [PATCH 16/17] changed style to make unavailable dates fainter --- build/angular-mighty-datepicker.css | 7 +++++-- src/angular-mighty-datepicker.less | 9 +++++---- 2 files changed, 10 insertions(+), 6 deletions(-) mode change 100644 => 100755 build/angular-mighty-datepicker.css mode change 100644 => 100755 src/angular-mighty-datepicker.less diff --git a/build/angular-mighty-datepicker.css b/build/angular-mighty-datepicker.css old mode 100644 new mode 100755 index a2d856b..b777272 --- a/build/angular-mighty-datepicker.css +++ b/build/angular-mighty-datepicker.css @@ -1,10 +1,13 @@ .mighty-picker-calendar__day { cursor: pointer; position: relative; - color: #333; + color: #050505; + /* almost black */ } .mighty-picker-calendar__day--disabled { - color: #aaa; + color: #ffc3bb; + /* very light red */ + font-style: italic; cursor: auto; } .mighty-picker-calendar__day--in-range { diff --git a/src/angular-mighty-datepicker.less b/src/angular-mighty-datepicker.less old mode 100644 new mode 100755 index 6201268..8e709f9 --- a/src/angular-mighty-datepicker.less +++ b/src/angular-mighty-datepicker.less @@ -1,10 +1,11 @@ .mighty-picker-calendar__day { cursor: pointer; position: relative; - color: #333; + color: #050505; /* almost black */ } .mighty-picker-calendar__day--disabled { - color: #aaa; + color: #ffc3bb; /* very light red */ + font-style: italic; cursor: auto; } .mighty-picker-calendar__day--in-range { @@ -12,7 +13,7 @@ font-weight: bold; } .mighty-picker-calendar__day-marker-wrapper { - position: relative + position: relative; } .mighty-picker-calendar__day-marker { display: none; @@ -36,4 +37,4 @@ .mighty-picker__month { display: inline-block; margin: 0 6px; -} +} \ No newline at end of file From 23a8d8414b88e080b8116c1b14d604d9b0f9153a Mon Sep 17 00:00:00 2001 From: Marco Solari Date: Fri, 1 Jul 2016 14:38:20 +0200 Subject: [PATCH 17/17] changed style to make unavailable dates fainter --- build/angular-mighty-datepicker.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/angular-mighty-datepicker.css b/build/angular-mighty-datepicker.css index b777272..3960327 100755 --- a/build/angular-mighty-datepicker.css +++ b/build/angular-mighty-datepicker.css @@ -1,8 +1,7 @@ .mighty-picker-calendar__day { cursor: pointer; position: relative; - color: #050505; - /* almost black */ + color: #050505; /* almost black */ } .mighty-picker-calendar__day--disabled { color: #ffc3bb;