【问题标题】:react-native-calendars moved 1 day forwardreact-native-calendars 提前 1 天
【发布时间】:2020-10-30 14:01:08
【问题描述】:

创建帖子时,是 30 日星期五。出于某种原因,我的日历将这一天显示为星期六:

enter image description here

我的日历代码:

          <Calendar
            style={{width: Dimensions.get('screen').width - 10}}
            theme={{
              selectedDayBackgroundColor: '#00adf5',
              selectedDayTextColor: '#ffffff',
              dotColor: '#00adf5',
            }}
            onDayPress={this.onDaySelect}
            markedDates={this.state.markedDates}
            markingType="single"
            minDate={minDate}
            maxDate={maxDate}
            disableAllTouchEventsForDisabledDays={true}
          />

【问题讨论】:

  • 这很奇怪。甚至您的Wednesday 拼写错误。有人碰过你的代码吗?
  • @kenmistry 不。我一个人在做这个项目

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


【解决方案1】:

转到此文件位置

react-native-calenders -> src -> calendar -> header -> index.js

改变了

let weekDaysNames = weekDayNames(this.props.firstDay);
to 
let weekDaysNames = weekDayNames(6);

我也遇到过同样的问题

我已经通过上述解决方案解决了这个问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-02-12
    • 1970-01-01
    • 1970-01-01
    • 2023-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多