活动日期的完整日历警报
我的问题是: 当今天的日期是 FullCalendar 中的事件日期时,是否可以触发某些内容(即警报、Qtip 等)?我使用 Google 日历中的 XML 作为源,并希望在人们的生日时弹出一些内容。
我已经有了:
var difference = birthdate - today;
var days = Math.round(difference/(1000*60*60*24));
if (days == 0){
$('#tabs').qtip({
position: {
my: 'bottom right',
at: 'top left',
},
content: "It's someone's birthday!!!",
show: {
when: false,
ready: true
},
hide: false,
style: {
classes: 'ui-tooltip-rounded',
}
});
}
其中 birthday 是个人的生日(我将其设置为 var),而 today 显然是今天的日期。 我遇到的问题是,这不是很有活力,因为我必须为每个人单独执行此操作。
非常感谢。
my question is:
Is it possible to trigger something (ie. alert, Qtip, whatever) when today's date is the date of an event in the FullCalendar? I am using the XML from my Google calendar as the source and would like something to pop up for people's birthdays.
I already have:
var difference = birthdate - today;
var days = Math.round(difference/(1000*60*60*24));
if (days == 0){
$('#tabs').qtip({
position: {
my: 'bottom right',
at: 'top left',
},
content: "It's someone's birthday!!!",
show: {
when: false,
ready: true
},
hide: false,
style: {
classes: 'ui-tooltip-rounded',
}
});
}
Where birthday is the individuals birthdate (which I set as a var) and today is ,obviously, today's date.
The problem I have is that this is not very dynamic as I will have to do this seperately for everyone.
Many thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建日历对象/函数时,您需要创建一个 eventAfterRender 函数。仅当您有已放置在日历上的功能时才会触发此操作。然后您可以读取日期并将其与生日进行比较并显示弹出窗口。我希望这就是您所寻找的。我举了一个小例子。
When you create your calendar object/function you need to create a eventAfterRender function. This only fires when you have a function that has been placed on the calendar. Then you can read the date and compare it to ones birthday and display popup. I hope that is what your were looking for. I gave a little example.