【问题标题】:How do I set a select only year option in ng2-datepicker?如何在 ng2-datepicker 中设置仅选择年份选项?
【发布时间】:2019-11-17 23:27:35
【问题描述】:

我想在 ng2-datepicker 中只选择年份选项。我如何做到这一点?

我在模块中找不到禁用日期选择的选项

【问题讨论】:

标签: angular ng2-datepicker


【解决方案1】:
import { DatepickerOptions } from 'ng2-datepicker';
import * as frLocale from 'date-fns/locale/fr';

let options: DatepickerOptions = {
  minYear: 1970,
  maxYear: 2030,
  displayFormat: 'YYYY'
}

在 Datepicker 函数调用中添加选项

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-09-13
    • 1970-01-01
    • 1970-01-01
    • 2012-10-10
    • 1970-01-01
    • 2018-07-05
    • 2016-01-17
    相关资源
    最近更新 更多