- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法动态更改选定的日期。例如,我想在离开屏幕时将选定的日期更改为今天;我不想在今天以外的其他日期离开...我该怎么做?我正在使用议程。另外,我想在用户单击该屏幕中的某个按钮时更改选定的日期。如果我只是将状态设置为 selectedDay...,我的议程列表日期根本不会改变......
我现在的代码;
componentDidMount() {
this.props.navigation.addListener('didBlur', (playload)=>{
console.log(playload);
this.onDayPress(Moment().format('YYYY-MM-DD').toString());
});
}
我的议程:
<Agenda
// the list of items that have to be displayed in agenda. If you want to render item as empty date
// the value of date key kas to be an empty array []. If there exists no value for date key it is
// considered that the date in question is not yet loaded
items={this.state.items2}
// callback that gets called when items for a certain month should be loaded (month became visible)
//loadItemsForMonth={}
// callback that fires when the calendar is opened or closed
onCalendarToggled={(calendarOpened) => {}}
// callback that gets called on day press
onDayPress={this.onDayPress.bind(this)}
// callback that gets called when day changes while scrolling agenda list
onDayChange={(day)=>{
this.setState({day: day})
console.log('OnDayChange: ' + day);
}}
// initially selected day
//selected={ Moment().format('YYYY-MM-DD').toString()}
//selected={'2018-02-20'}
selected={this.state.selectedDay}
// Minimum date that can be selected, dates before minDate will be grayed out. Default = undefined
minDate={this.state.minDate}
// Maximum date that can be selected, dates after maxDate will be grayed out. Default = undefined
maxDate={this.state.maxDate}
...
onDayPress 方法;
onDayPress(day) {
//console.log('Predn zamenjam selected day: ' + this.state.selectedDay);
if(day.dateString === undefined) {
if(day !== undefined) {
//console.log('day: ' + day);
this.setState({
selectedDay: day
});
return true;
}
}
this.setState({
selectedDay: day.dateString
});
this.getNextThreeDays(day.dateString);
this.getQuotes(day.dateString);
}
npm ls react-native-calendars
: 1.19.4npm ls react-native
: ^0.55.4最佳答案
晚了几年,但设法使用 refs 解决了这个问题
import React, { createRef } from 'react';
const agendaRef = createRef();
渲染议程时包含引用
<Agenda
ref={agendaRef}
...
/>
对于按钮的 onPress
函数,包括对 chooseDay
的调用
const date = '2020-10-01' // the date you want to go to
agendaRef.current.chooseDay(date)
它应该像点击日期按钮一样动画
关于react-native - 议程 - 动态更改选定的日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52437947/
我有一个包含用户及其每周日历的 mysql 表。 每个用户都可以设置自己一周的空闲时间(早上、下午、晚上/周一到周六),并且不会经常更改,几乎永远不会更改。 想象一下,这些用户是健身房的私有(priv
我无法动态更改选定的日期。例如,我想在离开屏幕时将选定的日期更改为今天;我不想在今天以外的其他日期离开...我该怎么做?我正在使用议程。另外,我想在用户单击该屏幕中的某个按钮时更改选定的日期。如果我只
如何添加操作监听器,以便在单击议程上的约会时打开一个新窗口,其中包含有关该特定单击约会的更多详细信息。 最佳答案 Agenda 似乎没有相应的 api。您可以看到议程的来源:AbstractAppoi
我在使用带有议程 View 的全日历时遇到了一些问题。在周 View 中,网格内没有垂直边框,如您在这张图片中所见: http://cjoint.com/14av/DDlkmc7Kjgp.htm在基本
议程/cron 支持这种情况的重复吗?示例:在周一和周二每两周重复一次工作,我可以每两周重复一次工作,但不能在特定日期重复一次工作,如果是,时间间隔的表达式是什么。周和日都可以是动态的。谢谢 最佳答案
我想在每天 8:30 到 17:00 的日程 View 中只显示营业时间, 像下面这样: 最佳答案 您是在问如何隐藏营业时间以外的时间吗?如果是这样,请使用 minTime 和 maxTime 选项:
从议程 View 中,我想按一个键并从该 TODO 条目中删除 SCHEDULED: 行。 最佳答案 按 C-u C-c C-s 要重建议程缓冲区,请按 r 请参阅 The manual 中的议程命
使用 Agenda ,是否可以设置作业在失败后多次重试? 最佳答案 不直接支持重试作为选项,但通过将失败的作业 nextRunAt 设置为 future 时间,它有一个简单的解决方法。 引用这篇文章:
我已将 FullCalendar 版本从 v. 2.3.1 更新到 2.4.0,之前一切正常,但现在在 周 View 和 议程 View 中 我无法添加该事件。这件事很奇怪,因为在月 View 中我看
我希望 Org-mode 议程在我打开 Emacs 时自动显示我今天必须做的事情。 org-agenda 命令是交互式的,因此它似乎不适用于此目的。 有没有办法在 Emacs 启动时显示 Org-mo
最近,我开始使用来自以下 repo 的日历控件:https://github.com/wix/react-native-calendars最初日历控件正确对齐所有项目,但似乎有些东西完全破坏了对齐。
我通过表单从用户那里收集了 Activity 日期、标题、地点、参加者、开始和结束时间、位置和其他元数据,然后存储在 mysql 数据库表中。我想从数据库中检索事件并以 Google 日历样式列出它们
我正在使用来自 http://jfxtras.org/ 的 FXtras(版本 8.0-r5)议程,我在其中定义了两种类型的约会:个人(group1)和共享(group2)。用户可以编辑个人约会的时间
我想安排这样的任务: 安排 11 月 1 日开始的任务 之后每个月重复该任务 我不想在任务安排在 11 月 1 日才开始的那一刻运行它。 我正在使用 Agenda.js我需要确保我正确地执行了此操作,
我尝试使用以下 CSS 隐藏 kendo 调度程序议程 View 中的时间列。 .k-scheduler-timecolumn{ visibility:collapse !important;
我是一名优秀的程序员,十分优秀!