【问题标题】:React Native:How to get the date of the calendar viewReact Native:如何获取日历视图的日期
【发布时间】:2018-10-24 04:01:28
【问题描述】:

我正在使用 React-native-calendar 来显示现有预订的日期。我正在寻找如何获取日历上一个月后的月份日期

https://github.com/wix/react-native-calendars

我可以看到他们在顶部指定了一个日历对象,但我可以如何访问它,在本机反应中。

【问题讨论】:

    标签: react-native events calendar react-native-calendars


    【解决方案1】:

    您可以使用onMonthChange 事件获取日历的当前可见月份。

    // Handler which gets executed when visible month changes in calendar. Default = undefined
      onMonthChange={(month) => {console.log('month changed', month)}}
    

    【讨论】:

    • 好的,谢谢。我刚试过。没有意识到它不是月份,是日历对象本身。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多