Currently, I am developing a web application where I am utilizing a date picker feature from the Materialangular calendar extender.
<md-datepicker ng-model="mddate" ng-blur="dateformatechanged()" md-placeholder="Enter date"></md-datepicker>
Within my controller, I am retrieving the date data as follows:
$scope.datemm = moment($scope.mddate).format('MM');
$scope.dateyy = moment($scope.mddate).format('YYYY');
console.log($scope.datemm);
console.log($scope.dateyy);
Specifically, in my $scope.datemm
variable, the month values appear as 01,02,03,04
depending on the selected month. However, I am aiming to display the month names instead (January, February, March, April
).
What modifications should I make to my controller in order to achieve this desired month output?