javascript - Fullcalendar 不会加载事件
问题描述
我们正试图让 Fullcalendar 显示一些事件。我们从数据库的 ajax 调用中获取事件。然后在 ajax 成功处理程序中,我们将数组设置为 Fullcalendar 上的 events 属性
$.ajax({
type: 'GET',
contentType: 'application/json',
url: '/api/Bookings/' + sessionStorage.getItem("id"),
success: function (eventsArr) {
eventSources: [
{
events: eventsArr,
color: 'blue',
textColor: 'white'
}
],
但是,事件不会显示在日历中。
返回的数组可能如下所示
[
{
"title": "",
"start": "2018-01-01T01:01:01",
"description": "fefefefef"
},
{
"title": "",
"start": "2018-05-15T12:03:00",
"description": "something"
},
{
"title": "sfse Undervisning",
"start": "2018-05-16T12:59:00",
"description": "something2"
},
{
"title": "Matematik",
"start": "2018-05-17T12:30:00",
"description": "2+2"
},
{
"title": "Dansk",
"start": "2018-05-18T13:00:00",
"description": "Vikingtiden"
},
{
"title": "test",
"start": "2018-05-29T00:00:00",
"description": "sefs"
},
{
"title": "something",
"start": "2018-05-30T00:00:00",
"description": "sef"
}
]
解决方案
推荐阅读
- laravel - 使用 Laravel 过滤表下拉 livewire
- docker - 使用 buildkit 和 mirror.gcr.io 构建 Docker 在未缓存的图像上失败
- windows - 在 Windows 上使用 gettext 的 CMake 项目
- php - 当 include_once 在文件中时,PHP localhost 页面不加载
- vb.net - 查找列表框的索引
- django - 如何将教师学生功能植入 django?
- python - 如何在 Selenium Chromedriver 中更改 True Browser Core
- spring - 如何在没有身份验证但立即返回 401 时禁用 keycloak 登录页面提示?
- python - 如何有效地计算嵌套在numpy ndarray中的数组的指定索引?
- python - dask 延迟函数是否使用相同的 conda 环境?