Angular-Material设置了只有几个月和几年的Datepicker [英] Angular-Material set a Datepicker with only months and years

查看:134
本文介绍了Angular-Material设置了只有几个月和几年的Datepicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用角度1.5.9&角材设计1.1.1

I'm using angular 1.5.9 & angular material design 1.1.1

我想添加一个Datepicker,仅包含月份和年份,没有天,这是针对结帐表格中的信用卡到期字段的.

I would like to add a Datepicker with months and years only, no days, it's for a credit card expiration field in a checkout form.

推荐答案

您可以在下面设置md-mode="month"工作演示

You can set md-mode="month" working demo below

   <md-input-container flex="100" layout="column">
          <div style="font-size: 10px; color: blue;" label ng-bind="::dateFields[2].label"></div>
          <md-datepicker ng-model="dateFields.selectedDate"
                     ng-required="dateFields.required"
                     md-date-locale="dateFields.locale"
                     md-mode="month"
                     md-open-on-focus="true">
        </md-datepicker>
    </md-input-container>

演示

DEMO

这篇关于Angular-Material设置了只有几个月和几年的Datepicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆