【问题标题】:UI Kitten calendar future years disabledUI 小猫日历未来年份已禁用
【发布时间】:2021-09-26 16:30:09
【问题描述】:

有谁明白为什么UI Kitten Calendar component 仅在当年启用?现在是 2021 年,当我尝试在演示实时视图中为“简单用法”选择未来或过去几年中的某一天时,它们被禁用了..

【问题讨论】:

    标签: react-native-ui-kitten


    【解决方案1】:

    看起来有 2 个 props startDateendDate props 你可以像这样指定

    export interface CalendarRange<D> {
      startDate?: D;
      endDate?: D;
    }
    
    <Calendar
      date={date}
      onSelect={nextDate => setDate(nextDate)}
      endDate={endDate} <------ add this
    />
    

    endDate 的值我想你可以看看How to properly add 1 month from now to current date in moment.js,因为 KittenUI 日历正在使用 moment.js。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-17
      • 1970-01-01
      • 1970-01-01
      • 2015-02-07
      • 2011-04-29
      相关资源
      最近更新 更多