如何解决完整日历显示列表视图日槽开始和结束时间,而不是全天
我想在两天内在日历中显示特定时间的事件,例如
ABC: 2/11/2020 - 2/15/2020 (for time 02:00:00 to 03:00:00)
DEF: 2/11/2020 - 2/15/2020 (for time 02:00:00 to 05:00:00)
EFG: 2/12/2020 - 2/17/2020 (for time 02:00:00 to 03:00:00)
日历列表视图显示时间与类 fc-list-item-time 默认情况下是全天我搜索解决方案但找不到它。我尝试了以下不符合我当前要求的脚本。 日历初始化事件参数看起来像
events: [
// ---------------- php loop over this for above entires ---------------
{
title: 'abc',start: '2020-2-11 02:00:00',description: 'Reservation By Dummy',end: '2020-02-15 03:00:00',// ------------------- these also doesnt give me desired result -------------------
// setStart:"",// minTime:"",// recurstart:"",// recurend:"",// ranges:[{start:"02:00:00",end:"03:00:00"}],// ----------------------------------------------------------------------------
className: "fc-event-success"
},// ---------------- php loop over this for above entires ---------------
],
当我使用 time 时也直接使用 start 参数并结束一个 (就像上面的例子) 然后它显示 all-day 除了最后一天和之后的所有日子最后一天显示结束时间。
我希望它显示为
解决方法
我做到了
events: [
// ---------------- php loop over this for above entires ---------------
{
title: 'abc',start: '2020-2-11',description: 'Reservation By Dummy',end: '2020-02-15',mycustomparameter1: '02:00:00',mycustomparameter2: '03:00:00',className: "fc-event-success"
},// ---------------- php loop over this for above entires ---------------
],
我在eventRender函数的帮助下解决
eventRender: function (info) {
var element = $(info.el);
if (info.event.extendedProps) {
if (element.find('.fc-list-item-time').lenght !== 0) {
element.find('.fc-list-item-time').html(info.event.extendedProps.mycustomparameter1+'-'+info.event.extendedProps.mycustomparameter2);
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。