Шаги для достижения этой цели ...
- принимает дату как ввод от пользователя;
- рассчитать первую и последнюю даты этого месяца;
- запустить цикл, который получает все промежуточные даты и сохраняет их в массиве;
- выводит массив на экран
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.particularDate;
$scope.relevantMonth;
$scope.relevantYear;
$scope.relevantFirstDate;
$scope.relevantLastDate;
$scope.calcDate = function() {
if ($scope.selectedDate) {
$scope.yearPart = $scope.selectedDate.toString().substring(11, 15);
$scope.particularDate = new Date($scope.selectedDate.toString().substring(0, 10));
$scope.particularDate.setYear($scope.yearPart);
$scope.relevantMonth = $scope.particularDate.getMonth() + 1;
$scope.relevantYear = $scope.particularDate.getFullYear();
$scope.relevantLastDate = new Date($scope.relevantYear, $scope.relevantMonth, 0);
$scope.relevantFirstDate = new Date($scope.relevantYear, $scope.relevantMonth - 1, 1);
$scope.fillAllDays();
}
}
$scope.fillAllDays = function() {
$scope.monthArray = [];
var t = $scope.relevantFirstDate;
$scope.monthArray.push(t.toLocaleDateString());
for (var i = $scope.relevantFirstDate.getDate(); i < $scope.relevantLastDate.getDate(); i++) {
t.setDate(t.getDate() + 1);
$scope.monthArray.push(t.toLocaleDateString());
}
}
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
Date: <input type='date' ng-model='selectedDate' ng-change='calcDate()' /> <br>
<hr/>
<p ng-repeat='x in monthArray'>{{x}}</p>
</div>