如何在UI5中仅输入月份和年份? [英] How to input only month and year in UI5?

查看:89
本文介绍了如何在UI5中仅输入月份和年份?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我可以插入日期时间输入:
https://ui5.sap.com/#/entity/sap.m.DateTimeInput/sample/sap.m.sample.DateTimeInput

Here I see I can insert a date-time input: https://ui5.sap.com/#/entity/sap.m.DateTimeInput/sample/sap.m.sample.DateTimeInput

<DateTimeInput type="Date" placeholder="Enter Date ..." />

但是我希望用户仅选择月份和年份,而不是天。
有可能吗?

But I want the user to choose only month and year, not the day. Is it possible?

推荐答案

是的,非常简单:

将以下属性添加到您的 DateTimeInput displayFormat = MM / yyyy

Add the following attribute to your DateTimeInput: displayFormat="MM/yyyy"

这篇关于如何在UI5中仅输入月份和年份?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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