Skip to content

Instantly share code, notes, and snippets.

@endash
Created February 13, 2014 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save endash/8986106 to your computer and use it in GitHub Desktop.
Save endash/8986106 to your computer and use it in GitHub Desktop.
$scope.$watch('[min, max]', function (vals) {
var min = vals[0], max = vals[1], date = $scope.date;
var start = moment(date),
end = moment(date);
start.hour(min/60);
start.minute(min % 60);
end.hour(max/60);
end.minute(max % 60);
$scope.selectedRange = moment().range(start, end);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment