reactjs - MaterialUI ReactJS 中的月份和年份选择器

标签 reactjs date datetime material-ui

有什么方法可以使用 Material UI 实现月份选择器和年份选择器。
在月 View 中,输出应该只有月和年,例如:- 2020-09

最佳答案

您可以使用本节中演示的不同 View here .

<DatePicker
  variant="inline"
  openTo="year"
  views={["year", "month"]}
  label="Year and Month"
  helperText="Start from year selection"
  value={selectedDate}
  onChange={handleDateChange}
/>
现场演示
Edit 64112889/month-and-year-picker-in-materialui-react-js

关于reactjs - MaterialUI ReactJS 中的月份和年份选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64112889/

相关文章:

python - 在 python 中导入 Pandas 会改变 matplotlib 处理日期时间对象的方式吗?

reactjs - 如何为 React SSR 和 API 构建 monorepo

javascript - React js控制componentDidUpdate()方法

javascript - React-Native 中的 Alt @decorators

python - 使用 strptime() 进行日期转换

php - Doctrine 修改后的 DateTime 不会持久化

javascript - react - 选择导致页面向下滚动

php - 根据 Woocommerce 产品循环中的日期时间规则显示下一个交货日

c# - 从 Excel 读取的随机日期格式

c - 有效计算闰日