如何使用没有日期的fullcalendar。 [英] How to use fullcalendar without date.

查看:89
本文介绍了如何使用没有日期的fullcalendar。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将fullcalendar用作没有日期相关的抽象日历,例如,如果我想安排一个包含3周事件的程序,并且这些事件在日历上展开,例如从第3天到第1天的事件1 10,依此类推。



我被告知我可以使用 fullcalendar.js ,所以如果有人可以帮我这个?

解决方案

只是一个想法。



为什么不选择随机周。说今年第2周。



我假设您使用agendaWeek视图。如果没有,你可以为任何其他观点提出一个simulair解决方案。



这是从;

1/5/2015到2015年9月5日(假设为5天活动)所以周末=假



不显示标题所以header = null





您现在在事件回调函数中将事件填入日历中。



你来了你可以在随机周内开始你的结束时间。

所以第一天的事件可以有一个

 event.title = < span class =code-string> 第1天的第一个事件; 
event.start = moment(' 1/5/2015 8:00',< span class =code-string>' MM / DD / YYYY HH:mm');
event.end = moment(' 1/5/2015 11:00',< span class =code-string>' MM / DD / YYYY HH:mm');



现在唯一的问题是当天的标题代表日期。这可以通过以下方式轻松修复:

 


。fc-day-header.fc-mon)。html( 第1天);


.fc-day-header.fc-tue)。html( 第2天);


How to use fullcalendar as an abstract calendar with no date related, for example, if I want to schedule a program with 3 weeks events, and these events are spreaded on the calendar, like "Event 1" from day 3 to day 10, and so on.

I have been told that I can use fullcalendar.js, so if anyone can help me with this?

解决方案

Just an idea.

Why not pick a random week. Say week 2 of this year.

I'm going to assume you use the agendaWeek view. If not you could come up with a simulair solution for any of the other views.

This runs from;
1/5/2015 to 9/5/2015 (assuming a 5 day event) so weekends=false

Do not show the header so header=null


You now fill you're events into the calendar in the events callback function.

You come up with start en end times inside you're random week.
So an event on day1 could have a

event.title="First event on day1";
event.start=moment('1/5/2015 8:00', 'MM/DD/YYYY HH:mm');
event.end=moment('1/5/2015 11:00', 'MM/DD/YYYY HH:mm');


The only issue now is that the headers of the day's represent dates. This could be fixed easily by;


(".fc-day-header.fc-mon").html("Day 1");


(".fc-day-header.fc-tue").html("Day 2");


这篇关于如何使用没有日期的fullcalendar。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆