greatCodeIdeas / md-date-range-picker

Angular Material Date Range Picker Service/Directive
MIT License
62 stars 40 forks source link

is func inCurrentMonth missing years? #46

Closed orlandovallejos closed 6 years ago

orlandovallejos commented 6 years ago

I believe there is a comparison missing for years in this particular function. Because months can be the same, but not the year, and that should trigger the focus method.

This is what I'm talking about:

function inCurrentMonth(date, isSecondMonth) {
  return !isSecondMonth ?
     date.getMonth() === $scope.activeMonth && date.getFullYear() === $scope.activeYear:
     date.getMonth() === $scope.activeMonth2 && date.getFullYear() === $scope.activeYear2;
}