Skip to content

Commit d74a512

Browse files
committed
Fire callbacks on change of date directly inside setDate function.
1 parent a5d4397 commit d74a512

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/datetime-range.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ angular.module('g1b.datetime-range', []).
5353
if ( (scope.selected.clone().startOf('week').month() !== scope.calendar.month() && scope.selected.clone().endOf('week').month() !== scope.calendar.month()) || calendar_update ) {
5454
scope.calendar = scope.selected.clone();
5555
}
56-
scope.callback();
56+
if ( scope.selected === scope.start ) {
57+
scope.callbackStart();
58+
}
59+
if ( scope.selected === scope.end ) {
60+
scope.callbackEnd();
61+
}
62+
scope.callbackAll();
5763
} else {
5864
scope.warning = ( scope.selected === scope.start ) ? 'end' : 'start';
5965
$timeout(function () {

0 commit comments

Comments
 (0)