如何在 AngularJS Material 中获得年份日期选择器? [英] How to get a year datepicker in AngularJS Material?

查看:27
本文介绍了如何在 AngularJS Material 中获得年份日期选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何 md-year 选择器可用?如果是,请分享一些链接.如果不是,那么是否可以将 md-datepicker 变成年份选择器?

Are there any md-year pickers available? if yes, please share me some links. If no, then is it possible to turn a md-datepicker into a year picker?

我尝试了一个普通的,提供模式、模型类型等,但没有有用的输出.

I have tried with a normal one with giving modes, types of models etc but no useful output.

推荐答案

在文档中在 上,有一个年份选择器选项,通过使用 md-current-view 属性,将其设置为 yearmonth:

In the docs on <md-datepicker>, there is an option for a year picker by using the md-current-view attribute, setting it to either year or month:

<md-datepicker
    md-current-view="year"
    ng-model="myCustomYearDate"
    md-placeholder="Enter Date">
</md-datepicker>

这篇关于如何在 AngularJS Material 中获得年份日期选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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