【发布时间】:2017-02-04 12:18:54
【问题描述】:
我正在做一个项目,我有一个 md-datepicker,我希望这个 md-datepicker 只显示一年中的月份(一月、二月等等......)。我该怎么做?
到目前为止,这是我的代码:
HTML
<md-datepicker ng-model="currentDate" md-current-view="month" md-date-filter="monthlyDate"></md-datepicker>
JS
var app = angular.module("DashboardApp", ['ngMaterial', 'ngAnimate','md.data.table']);
app.controller('rptController', ['$scope', function ($scope) {
$scope.currentDate = new Date();
$scope.monthlyDate = new Date($scope.currentDate.getMonth('MM'))}]);
【问题讨论】:
标签: angularjs datepicker material-design angular-material