【问题标题】:How do I set the startDate in an Angular-Bootstrap ngb-datepicker如何在 Angular-Bootstrap ngb-datepicker 中设置 startDate
【发布时间】:2018-08-01 20:08:01
【问题描述】:

我想在我的应用程序中使用 ngb-datepicker。 According to this documentation,该组件有一个 startDate 输入,用于控制日历的初始日期。我不知道如何设置这个日期。由于没有使用此输入的示例,我不得不猜测。我已经尝试了这些行中的每一个,但它们都不起作用。

  1. <ngb-datepicker startDate="2018-11-01"></ngb-datepicker>
  2. <ngb-datepicker startDate="{ year: 2018; month: 11; }"></ngb-datepicker>
  3. <ngb-datepicker startDate.year="2018" startDate.month="11"></ngb-datepicker>

我该怎么做?>

【问题讨论】:

    标签: angular datepicker angular6


    【解决方案1】:

    他们确实在文档中显示了它。它在概述部分的“移动”小节中。是这样的:

    <ngb-datepicker [startDate]="{year: 2018, month: 11}"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多